private function createResponse(GuzzleResponse $response)
    {
        $body = $response->getBody();

        return $this->responseFactory->createResponse(
            $response->getStatusCode(),
            null,
            $response->getHeaders(),
            isset($body) ? $body->detach() : null,
            $response->getProtocolVersion()
        );
    }