Improved validator