refactoring steps into methods