Register User, refactoring