refactor install plugin