public function generateAndRender($content, $data)
    {
        $filename = $this->generateViewFile($content);
        try {
            $rendered = $this->render($filename, $data);
        } catch (\Exception $e) {
            $this->remove($filename);
            throw $e;
        }

        $this->remove($filename);

        return $rendered;
    }