protected function _containerUnset(&$container, $key)
    {
        $origKey = $key;
        $key     = $this->_normalizeKey($key);

        if (is_array($container)) {
            if (!isset($container[$key])) {
                throw $this->_createNotFoundException($this->__('Key "%1$s" not found', [$key]), null, null, null, $key);
            }

            unset($container[$key]);

            return;
        }

        if ($container instanceof stdClass) {
            if (!isset($container->{$key})) {
                throw $this->_createNotFoundException($this->__('Key "%1$s" not found', [$key]), null, null, null, $key);
            }

            unset($container->{$key});

            return;
        }

        if ($container instanceof ArrayAccess) {
            try {
                $hasKey = $container->offsetExists($key);
            } catch (RootException $e) {
                throw $this->_createContainerException($this->__('Could not check key "%1$s" on container', [$key]), null, $e, null);
            }

            if (!$hasKey) {
                throw $this->_createNotFoundException($this->__('Key "%1$s" not found', [$key]), null, null, null, $key);
            }

            try {
                $container->offsetUnset($key);

                return;
            } catch (RootException $e) {
                throw $this->_createContainerException($this->__('Could not unset key "%1$s" on container', [$key]), null, $e, null);
            }
        }

        throw $this->_createInvalidArgumentException($this->__('Invalid container'), null, null, $container);
    }