Streamlined query building