simplify code in method `getSteps`

/ping @havvg