Refactoring validate