refactored user creation procedure