Added support for different event types