Refactor routes.rb for application