Cleaner validation code