refactoring models validate method