Refactored to use event filter