Small refactoring in the Plugin subsystem.