protected function deleteHandler(/** @noinspection PhpUnusedParameterInspection */ I_Registry $args, $name, $index = null)
    {
        $cleanupAllHandlers = is_null($index);
        if (!$cleanupAllHandlers) {
            unset($this->handlers[$name][$index]);
            if (sizeof($this->handlers[$name])) {
                ksort($this->handlers[$name]);
                unset($this->orderedHandlers[$name]);
            } else {
                $cleanupAllHandlers = true;
            }
        }
        if ($cleanupAllHandlers) {
            // Cleanup all handlers with specified name
            unset($this->handlers[$name], $this->orderedHandlers[$name]);
        }
    }