refactor plugin

support install and uninstall