refactor histories in app/models/user.rb