WIP: Moved event handling from guest to the plugin