optimize steps.