refactored pluginManager