Moved and restructured event filter