used a more functional style for simple functions in UserValidation