more refactoring of user reg