refactoring of the validate method. pulled up into base class