make parent, child, and flag searching more efficient