refactor user register