private function register(array $providers, array $values)
    {
        foreach ($providers as $provider) {

            $factories = $provider->getFactories();

            foreach ($factories as $key => $callable) {
                $this[$key] = function (ContainerInterface $c) use ($callable) {
                    return call_user_func($callable, $c);
                };
            }

        }

        foreach ($providers as $provider) {

            $extensions = $provider->getExtensions();

            foreach ($extensions as $key => $callable) {

                if (isset($this->keys[$key])) {
                    // Extend a previous entry
                    $this[$key] = $this->extend($key, function ($previous, ContainerInterface $c) use ($callable) {
                        return call_user_func($callable, $c, $previous);
                    });
                } else {
                    $this[$key] = function (ContainerInterface $c) use ($callable) {
                        return call_user_func($callable, $c);
                    };
                }
            }

        }

        foreach ($values as $key => $value) {
            $this[$key] = $value;
        }
    }