Added basic infrastructure for event handling