Refactor validations.