further refactoring
edges filter