Refactoring model validation.