Improved data validation