Refactoring User validations to avoid duplication of code