public function &setContent($content)
    {
        // Set element type by analyzing the element
        switch (true) {

            case ($content instanceof FormGroup):
                $this->type = 'group';
                break;

            case ($content instanceof ControlsCollectionInterface):
                $this->type = 'collection';
                break;

            case ($content instanceof AbstractForm):
                $this->type = 'control';
                break;

            case ($content instanceof AbstractHtml):
                $this->type = 'factory';
                break;

            default:
                $this->type = 'html';
        }

        $this->content = $content;

        return $content;
    }