refactored the user.rb