Refactored Plugin.