refactored user validations to make code more clean