refactored filter to use pub/sub approach