Add refactored code to app.rb section in README