OPTIMIZATION - refactored how predicates are made while creating the compound predicate to looking for object relationships