public function remove($type, $index = null)
    {
        if ($index === null) {
            unset($this[$type]);
            return;
        }

        if(!isset($this[$type][$index])) {
            throw new NoSuchElementException("There is no rule '$type' type indexed by '$index'.");
        }

        unset($this[$type][$index]);
    }