refactored and improved pluginmanage
refactored and improved pluginmanage