private function extended(callable $factory, callable ...$extensions): callable
    {
        return array_reduce($extensions, function ($factory, $extension) {
            return new Extension($factory, $extension);
        }, $factory);
    }