refactored app.rb