Refactored dispatching to support various event types