Add events and plugin support