private function serviceFactoryMap(array $providers): array
    {
        $wrap = function ($factory) { return [$factory]; };

        return array_reduce($providers, function ($factories, ServiceProviderInterface $provider) use ($wrap) {

            return array_merge($factories, array_map($wrap, $provider->getFactories()));

        }, []);
    }