public function extend($name, $extender)
    {
        if (!is_callable($extender, true)) {
            throw new FactoryUncallableException('$extender must appear callable');
        }

        if (!array_key_exists($name, $this->factories)) {
            throw new NotFoundException("No factory available for: $name");
        }

        $factory = $this->factories[$name];

        $newFactory = function (Container $c) use ($extender, $factory) {
            return call_user_func($extender, call_user_func($factory, $c), $c);
        };

        $this->setFactory($name, $newFactory);

        return $newFactory;
    }