unified step_upto and step.