More ActiveRecord refactoring