public function get($key = null, $default = null)
    {
        if (is_null($key)) {
            return $this->elements;
        }
        if ($this->exists($this->elements, $key)) {
            return $this->elements[$key];
        }
        if (strpos($key, '.') === false) {
            return $default;
        }
        $items = $this->elements;
        foreach (explode('.', $key) as $segment) {
            if (!is_array($items) || !$this->exists($items, $segment)) {
                return $default;
            }
            $items = &$items[$segment];
        }
        return $items;
    }