refactored the output code in application.rb to commands