Refactoring user registration.