refactor validations.