refactoring of the creation of a new user