Improved validation