getAllRelations improved