refactored lineage filter for maps
refactored lineage filter for maps