Added support for events and more callbacks