further work on plugin system