refactor user creation