Clean up tricky querying where objects in one collection are also collections of other objects.