For ActiveRecord4.0.2 and refactoring