Refactor maybeInit logic from plugin facets into AbstractPluginFacet and add test case.