Upgrade to Rails 4.
Minor refactoring.