Refactoring the user.rb