get queries from SMARTS into CTABs more reasonably