         return .failure(.statusCodeError(statusCode: HTTPURLResponse.statusCode), HTTPURLResponse)
       }
     default:
-      let errorResult = resource.error(from: data)
-      if let errorResult = errorResult {
-        return .failure(.couldNotParseModel(error: errorResult), HTTPURLResponse)
+      if let error = resource.error(from: data) {
+        return .failure(.couldNotParseModel(error: error), HTTPURLResponse)
       } else {
         return .failure(.statusCodeError(statusCode: HTTPURLResponse.statusCode), HTTPURLResponse)
       }

    switch HTTPURLResponse.statusCode {
    case 400..<600:
      return .statusCodeError(statusCode: HTTPURLResponse.statusCode)
    default: break
    }

    if let error = error {
      return .sessionError(error: error)
    }
    return nil
  }

}

public enum NetworkResponse<Model> {
  case success(Model, HTTPURLResponse)
  case failure(NetworkServiceError, HTTPURLResponse?)
}

struct NetworkResponseHandler {
