Updated for plugin system