Simplified the validation of a query