Refactor getObjectsParents