Minor refactoring to step handler