Cleans code for Rails 4