Refactoring the plugin design