refactoring plugins