plugins refactoring