private function generateTemplateResponse(
        Renderer $renderer,
        ServerRequestInterface $request
    ) : ResponseInterface {
        $response = ($this->responseFactory)()->withStatus(StatusCodeInterface::STATUS_NOT_FOUND);
        $response->getBody()->write(
            $renderer->render($this->template, ['request' => $request])
        );

        return $response;
    }