Cleaning the plugin manager code