More plugin refactoring