refactored the Validate Method