<s>[INST] class CellRenderer
{
    public function render($header, $rows, $options)
    {
        $this->createCell($header, 'th');
        foreach ($rows as $row) {
            $this->createCell($row, 'td');
        }
    }

    protected function createCell($content, $type)
    {
        $this->prepairCellContent($content);
        $this->addCssClass('table-cell');
        echo "<{$type}>{content}</{$type}>";
    }

    protected function prepairCellContent($content)
    {
        if (is_array($content)) {
            $content = $this->prepareArrayContent($content);
            $this->addTooltip($content);
        } else {
            $content = (string)$content;
        }
        return $content;
    }

    protected function prepareArrayContent($content)
    {
        $result = '<ul>';
        foreach ($content as $item) {
            $result .= '<li>' . $this->prepareItem($item) . '</li>';
        }
        $result .= '</ul>';
        return $result;
    }

    protected function prepareItem($item)
    {
        if (is_array($item)) {
            $this->prepareItem($item);
        } else {
            return (string)$item;
        }
    }

    protected function addTooltip($content, $tooltip = '')
    {
        return '<span class="tooltip" title="' . $tooltip . '">' . $content . '</span>';
    }

    protected function addCssClass($class)
    {
        $this->attribute['class'] = $class;
    }
}

Which of the following would be the most sensible improvement for this code regarding the reusability and avoid code duplication?[/INST]