simplify queries