Removed unnecessary clauses from queries