Move creation of plugin referential from metadata to a new class