Added plugin support and event subscriptions