refactor validations