refactoring of plugin functions to pluginManager