refactoring
Update validation logic