Refine validate method
Implement validation