Refactored the step controller
Overall refactoring