More work on getting rid of sideeffects in custom steps.