Optimize event processing