protected function stripMetadata(array $array, $stripped = [])
    {
        $allowed = ['id', '__children'];
        foreach ($array as $item) {
            if (count($item['__children'])) {
                $item['__children'] = $this->stripMetadata($item['__children'], $stripped);
            }

            $stripped[] = array_intersect_key($item, array_flip($allowed));
        }

        return $stripped;
    }