refactor steps.rb to eliminate duplication