migrate creation of container to plugin_init()