refactor User.register