updated with new filter approach to handling links