Added support for configuring event listeners