Refactor user.rb