Light reshuffle to make it a bit more linear to read and get rid of a
bunch of args that aren't needed in all cases.
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
(cherry picked from commit ad847ff6acb77fbba0f3ab2e864784225fd41007)