simplify query setup