Improved validation method