check_ambiguity_on_ancestors method refactored