Core functionality in app.rb