refactored registration with user.rb validation