refactoring the stepcommand to prepare for issue #46