improved caching of query collections