Plugin system refactoring