Refactor handling steps, making the given steps relying on previous
steps.