protected function _createCell($className, $action, $plugin, $options)
    {
        /* @var \Cake\View\Cell $instance */
        $instance = new $className($this->request, $this->response, $this->getEventManager(), $options);

        $builder = $instance->viewBuilder();
        $builder->setTemplate(Inflector::underscore($action));

        if (!empty($plugin)) {
            $builder->setPlugin($plugin);
        }
        if (!empty($this->helpers)) {
            $builder->setHelpers($this->helpers);
        }

        if ($this instanceof View) {
            if (!empty($this->theme)) {
                $builder->setTheme($this->theme);
            }

            $class = get_class($this);
            $builder->setClassName($class);
            $instance->viewClass = $class;

            return $instance;
        }

        if (method_exists($this, 'viewBuilder')) {
            $builder->setTheme($this->viewBuilder()->getTheme());
        }

        if (isset($this->viewClass)) {
            $builder->setClassName($this->viewClass);
            $instance->viewClass = $this->viewClass;
        }

        return $instance;
    }