diff --git a/p2p/base/basic_ice_controller.cc b/p2p/base/basic_ice_controller.cc
index a0ff4cf..182845c 100644
--- a/p2p/base/basic_ice_controller.cc
+++ b/p2p/base/basic_ice_controller.cc
@@ -565,9 +565,9 @@
 bool BasicIceController::PresumedWritable(const Connection* conn) const {
   return (conn->write_state() == Connection::STATE_WRITE_INIT &&
           config_.presume_writable_when_fully_relayed &&
-          conn->local_candidate().type() == RELAY_PORT_TYPE &&
-          (conn->remote_candidate().type() == RELAY_PORT_TYPE ||
-           conn->remote_candidate().type() == PRFLX_PORT_TYPE));
+          conn->local_candidate().is_relay() &&
+          (conn->remote_candidate().is_relay() ||
+           conn->remote_candidate().is_prflx()));
 }
 
 // Compare two connections based on their writing, receiving, and connected
diff --git a/p2p/base/connection.cc b/p2p/base/connection.cc
index d0e6f1b..bf07dec 100644
--- a/p2p/base/connection.cc
+++ b/p2p/base/connection.cc
@@ -590,10 +590,8 @@
   // This connection should now be receiving.
   ReceivedPing(msg->transaction_id());
   if (field_trials_->extra_ice_ping && last_ping_response_received_ == 0) {
-    if (local_candidate().type() == RELAY_PORT_TYPE ||
-        local_candidate().type() == PRFLX_PORT_TYPE ||
-        remote_candidate().type() == RELAY_PORT_TYPE ||
-        remote_candidate().type() == PRFLX_PORT_TYPE) {
+    if (local_candidate().is_relay() || local_candidate().is_prflx() ||
+        remote_candidate().is_relay() || remote_candidate().is_prflx()) {
       const int64_t now = rtc::TimeMillis();
       if (last_ping_sent_ + kMinExtraPingDelayMs <= now) {
         RTC_LOG(LS_INFO) << ToString()
@@ -1579,8 +1577,7 @@
 
 void Connection::MaybeUpdatePeerReflexiveCandidate(
     const Candidate& new_candidate) {
-  if (remote_candidate_.type() == PRFLX_PORT_TYPE &&
-      new_candidate.type() != PRFLX_PORT_TYPE &&
+  if (remote_candidate_.is_prflx() && !new_candidate.is_prflx() &&
       remote_candidate_.protocol() == new_candidate.protocol() &&
       remote_candidate_.address() == new_candidate.address() &&
       remote_candidate_.username() == new_candidate.username() &&
diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc
index 070a25b..35d7f85 100644
--- a/p2p/base/p2p_transport_channel.cc
+++ b/p2p/base/p2p_transport_channel.cc
@@ -1416,8 +1416,7 @@
 
   if (ice_field_trials_.skip_relay_to_non_relay_connections) {
     if ((port->Type() != remote_candidate.type()) &&
-        (port->Type() == RELAY_PORT_TYPE ||
-         remote_candidate.type() == RELAY_PORT_TYPE)) {
+        (port->Type() == RELAY_PORT_TYPE || remote_candidate.is_relay())) {
       RTC_LOG(LS_INFO) << ToString() << ": skip creating connection "
                        << port->Type() << " to " << remote_candidate.type();
       return false;
@@ -1708,9 +1707,9 @@
   RTC_DCHECK_RUN_ON(network_thread_);
   return (conn->write_state() == Connection::STATE_WRITE_INIT &&
           config_.presume_writable_when_fully_relayed &&
-          conn->local_candidate().type() == RELAY_PORT_TYPE &&
-          (conn->remote_candidate().type() == RELAY_PORT_TYPE ||
-           conn->remote_candidate().type() == PRFLX_PORT_TYPE));
+          conn->local_candidate().is_relay() &&
+          (conn->remote_candidate().is_relay() ||
+           conn->remote_candidate().is_prflx()));
 }
 
 void P2PTransportChannel::UpdateState() {
@@ -1757,19 +1756,18 @@
 rtc::NetworkRoute P2PTransportChannel::ConfigureNetworkRoute(
     const Connection* conn) {
   RTC_DCHECK_RUN_ON(network_thread_);
-  return {
-      .connected = ReadyToSend(conn),
-      .local = CreateRouteEndpointFromCandidate(
-          /* local= */ true, conn->local_candidate(),
-          /* uses_turn= */
-          conn->port()->Type() == RELAY_PORT_TYPE),
-      .remote = CreateRouteEndpointFromCandidate(
-          /* local= */ false, conn->remote_candidate(),
-          /* uses_turn= */ conn->remote_candidate().type() == RELAY_PORT_TYPE),
-      .last_sent_packet_id = last_sent_packet_id_,
-      .packet_overhead =
-          conn->local_candidate().address().ipaddr().overhead() +
-          GetProtocolOverhead(conn->local_candidate().protocol())};
+  return {.connected = ReadyToSend(conn),
+          .local = CreateRouteEndpointFromCandidate(
+              /* local= */ true, conn->local_candidate(),
+              /* uses_turn= */
+              conn->port()->Type() == RELAY_PORT_TYPE),
+          .remote = CreateRouteEndpointFromCandidate(
+              /* local= */ false, conn->remote_candidate(),
+              /* uses_turn= */ conn->remote_candidate().is_relay()),
+          .last_sent_packet_id = last_sent_packet_id_,
+          .packet_overhead =
+              conn->local_candidate().address().ipaddr().overhead() +
+              GetProtocolOverhead(conn->local_candidate().protocol())};
 }
 
 void P2PTransportChannel::SwitchSelectedConnection(
@@ -2280,7 +2278,7 @@
   bool use_hostname_address = absl::EndsWith(c.address().hostname(), LOCAL_TLD);
   // Remove the address for prflx remote candidates. See
   // https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatestats.
-  use_hostname_address |= c.type() == PRFLX_PORT_TYPE;
+  use_hostname_address |= c.is_prflx();
   return c.ToSanitizedCopy(use_hostname_address,
                            false /* filter_related_address */);
 }
diff --git a/p2p/base/p2p_transport_channel_unittest.cc b/p2p/base/p2p_transport_channel_unittest.cc
index b30b294..a0446c7 100644
--- a/p2p/base/p2p_transport_channel_unittest.cc
+++ b/p2p/base/p2p_transport_channel_unittest.cc
@@ -5008,7 +5008,7 @@
     Connection* conn = FindNextPingableConnectionAndPingIt(channel_.get());
     ASSERT_TRUE(conn != nullptr);
     EXPECT_EQ(conn->local_candidate().type(), local_candidate_type);
-    if (conn->local_candidate().type() == RELAY_PORT_TYPE) {
+    if (conn->local_candidate().is_relay()) {
       EXPECT_EQ(conn->local_candidate().relay_protocol(), relay_protocol_type);
     }
     EXPECT_EQ(conn->remote_candidate().type(), remote_candidate_type);
@@ -5420,7 +5420,7 @@
 
   for (const auto& candidates_data : GetEndpoint(0)->saved_candidates_) {
     const auto& local_candidate_ep1 = candidates_data.candidate;
-    if (local_candidate_ep1.type() == LOCAL_PORT_TYPE) {
+    if (local_candidate_ep1.is_local()) {
       // This is the underlying private IP address of the same candidate at ep1,
       // and let the mock resolver of ep2 receive the correct resolution.
       rtc::SocketAddress resolved_address_ep1(local_candidate_ep1.address());
@@ -5449,11 +5449,11 @@
   // Check the stats of ep1 seen by ep1.
   for (const auto& connection_info : ice_transport_stats1.connection_infos) {
     const auto& local_candidate = connection_info.local_candidate;
-    if (local_candidate.type() == LOCAL_PORT_TYPE) {
+    if (local_candidate.is_local()) {
       EXPECT_TRUE(local_candidate.address().IsUnresolvedIP());
-    } else if (local_candidate.type() == STUN_PORT_TYPE) {
+    } else if (local_candidate.is_stun()) {
       EXPECT_TRUE(local_candidate.related_address().IsAnyIP());
-    } else if (local_candidate.type() == RELAY_PORT_TYPE) {
+    } else if (local_candidate.is_relay()) {
       // The related address of the relay candidate should be equal to the
       // srflx address. Note that NAT is not configured, hence the following
       // expectation.
@@ -5466,11 +5466,11 @@
   // Check the stats of ep1 seen by ep2.
   for (const auto& connection_info : ice_transport_stats2.connection_infos) {
     const auto& remote_candidate = connection_info.remote_candidate;
-    if (remote_candidate.type() == LOCAL_PORT_TYPE) {
+    if (remote_candidate.is_local()) {
       EXPECT_TRUE(remote_candidate.address().IsUnresolvedIP());
-    } else if (remote_candidate.type() == STUN_PORT_TYPE) {
+    } else if (remote_candidate.is_stun()) {
       EXPECT_TRUE(remote_candidate.related_address().IsAnyIP());
-    } else if (remote_candidate.type() == RELAY_PORT_TYPE) {
+    } else if (remote_candidate.is_relay()) {
       EXPECT_EQ(kPublicAddrs[0].ipaddr(),
                 remote_candidate.related_address().ipaddr());
     } else {
@@ -5592,7 +5592,7 @@
   ASSERT_EQ_WAIT(1u, GetEndpoint(0)->saved_candidates_.size(), kMediumTimeout);
   const auto& candidates_data = GetEndpoint(0)->saved_candidates_[0];
   const auto& local_candidate_ep1 = candidates_data.candidate;
-  ASSERT_TRUE(local_candidate_ep1.type() == LOCAL_PORT_TYPE);
+  ASSERT_TRUE(local_candidate_ep1.is_local());
   // This is the underlying private IP address of the same candidate at ep1,
   // and let the mock resolver of ep2 receive the correct resolution.
   rtc::SocketAddress resolved_address_ep1(local_candidate_ep1.address());
@@ -5608,12 +5608,12 @@
 
   const auto pair_ep1 = ep1_ch1()->GetSelectedCandidatePair();
   ASSERT_TRUE(pair_ep1.has_value());
-  EXPECT_EQ(LOCAL_PORT_TYPE, pair_ep1->local_candidate().type());
+  EXPECT_TRUE(pair_ep1->local_candidate().is_local());
   EXPECT_TRUE(pair_ep1->local_candidate().address().IsUnresolvedIP());
 
   const auto pair_ep2 = ep2_ch1()->GetSelectedCandidatePair();
   ASSERT_TRUE(pair_ep2.has_value());
-  EXPECT_EQ(LOCAL_PORT_TYPE, pair_ep2->remote_candidate().type());
+  EXPECT_TRUE(pair_ep2->remote_candidate().is_local());
   EXPECT_TRUE(pair_ep2->remote_candidate().address().IsUnresolvedIP());
 
   DestroyChannels();
diff --git a/p2p/base/port_allocator.cc b/p2p/base/port_allocator.cc
index 9292319..16f5afe 100644
--- a/p2p/base/port_allocator.cc
+++ b/p2p/base/port_allocator.cc
@@ -312,8 +312,7 @@
   // For a local host candidate, we need to conceal its IP address candidate if
   // the mDNS obfuscation is enabled.
   bool use_hostname_address =
-      (c.type() == LOCAL_PORT_TYPE || c.type() == PRFLX_PORT_TYPE) &&
-      MdnsObfuscationEnabled();
+      (c.is_local() || c.is_prflx()) && MdnsObfuscationEnabled();
   // If adapter enumeration is disabled or host candidates are disabled,
   // clear the raddr of STUN candidates to avoid local address leakage.
   bool filter_stun_related_address =
@@ -326,9 +325,9 @@
   // Sanitize related_address when using MDNS.
   bool filter_prflx_related_address = MdnsObfuscationEnabled();
   bool filter_related_address =
-      ((c.type() == STUN_PORT_TYPE && filter_stun_related_address) ||
-       (c.type() == RELAY_PORT_TYPE && filter_turn_related_address) ||
-       (c.type() == PRFLX_PORT_TYPE && filter_prflx_related_address));
+      ((c.is_stun() && filter_stun_related_address) ||
+       (c.is_relay() && filter_turn_related_address) ||
+       (c.is_prflx() && filter_prflx_related_address));
   return c.ToSanitizedCopy(use_hostname_address, filter_related_address);
 }
 
diff --git a/p2p/base/stun_port.cc b/p2p/base/stun_port.cc
index 7acaac6..648933f 100644
--- a/p2p/base/stun_port.cc
+++ b/p2p/base/stun_port.cc
@@ -285,7 +285,7 @@
   //
   // See also the definition of MdnsNameRegistrationStatus::kNotStarted in
   // port.h.
-  RTC_DCHECK(!SharedSocket() || Candidates()[0].type() == LOCAL_PORT_TYPE ||
+  RTC_DCHECK(!SharedSocket() || Candidates()[0].is_local() ||
              mdns_name_registration_status() !=
                  MdnsNameRegistrationStatus::kNotStarted);
 
@@ -616,7 +616,7 @@
   const std::vector<Candidate>& existing_candidates = Candidates();
   std::vector<Candidate>::const_iterator it = existing_candidates.begin();
   for (; it != existing_candidates.end(); ++it) {
-    if (it->type() == STUN_PORT_TYPE && it->address() == addr)
+    if (it->is_stun() && it->address() == addr)
       return true;
   }
   return false;
diff --git a/p2p/base/stun_port_unittest.cc b/p2p/base/stun_port_unittest.cc
index 04505d2..9167081 100644
--- a/p2p/base/stun_port_unittest.cc
+++ b/p2p/base/stun_port_unittest.cc
@@ -445,11 +445,11 @@
   // One of the generated candidates is a local candidate and the other is a
   // stun candidate.
   EXPECT_NE(port()->Candidates()[0].type(), port()->Candidates()[1].type());
-  if (port()->Candidates()[0].type() == cricket::LOCAL_PORT_TYPE) {
-    EXPECT_EQ(port()->Candidates()[1].type(), cricket::STUN_PORT_TYPE);
+  if (port()->Candidates()[0].is_local()) {
+    EXPECT_TRUE(port()->Candidates()[1].is_stun());
   } else {
-    EXPECT_EQ(port()->Candidates()[0].type(), cricket::STUN_PORT_TYPE);
-    EXPECT_EQ(port()->Candidates()[1].type(), cricket::LOCAL_PORT_TYPE);
+    EXPECT_TRUE(port()->Candidates()[0].is_stun());
+    EXPECT_TRUE(port()->Candidates()[1].is_local());
   }
 }
 
diff --git a/p2p/base/turn_port.cc b/p2p/base/turn_port.cc
index ff50636..1fb3b38 100644
--- a/p2p/base/turn_port.cc
+++ b/p2p/base/turn_port.cc
@@ -585,9 +585,8 @@
   // and TURN candidate later.
   for (size_t index = 0; index < Candidates().size(); ++index) {
     const Candidate& local_candidate = Candidates()[index];
-    if (local_candidate.type() == RELAY_PORT_TYPE &&
-        local_candidate.address().family() ==
-            remote_candidate.address().family()) {
+    if (local_candidate.is_relay() && local_candidate.address().family() ==
+                                          remote_candidate.address().family()) {
       ProxyConnection* conn =
           new ProxyConnection(NewWeakPtr(), index, remote_candidate);
       // Create an entry, if needed, so we can get our permissions set up
diff --git a/p2p/client/basic_port_allocator.cc b/p2p/client/basic_port_allocator.cc
index a31dc70..e95033e 100644
--- a/p2p/client/basic_port_allocator.cc
+++ b/p2p/client/basic_port_allocator.cc
@@ -126,11 +126,15 @@
     return false;
   }
 
-  if (c.type() == RELAY_PORT_TYPE) {
+  if (c.is_relay()) {
     return ((filter & CF_RELAY) != 0);
-  } else if (c.type() == STUN_PORT_TYPE) {
+  }
+
+  if (c.is_stun()) {
     return ((filter & CF_REFLEXIVE) != 0);
-  } else if (c.type() == LOCAL_PORT_TYPE) {
+  }
+
+  if (c.is_local()) {
     if ((filter & CF_REFLEXIVE) && !c.address().IsPrivateIP()) {
       // We allow host candidates if the filter allows server-reflexive
       // candidates and the candidate is a public IP. Because we don't generate
@@ -143,6 +147,7 @@
 
     return ((filter & CF_HOST) != 0);
   }
+
   return false;
 }
 
diff --git a/p2p/client/basic_port_allocator_unittest.cc b/p2p/client/basic_port_allocator_unittest.cc
index 43d552b..0c3bf6b 100644
--- a/p2p/client/basic_port_allocator_unittest.cc
+++ b/p2p/client/basic_port_allocator_unittest.cc
@@ -2417,7 +2417,7 @@
   for (const auto& candidate : candidates_) {
     const auto& raddr = candidate.related_address();
 
-    if (candidate.type() == LOCAL_PORT_TYPE) {
+    if (candidate.is_local()) {
       EXPECT_FALSE(candidate.address().hostname().empty());
       EXPECT_TRUE(raddr.IsNil());
       if (candidate.protocol() == UDP_PROTOCOL_NAME) {
@@ -2425,13 +2425,13 @@
       } else {
         ++num_host_tcp_candidates;
       }
-    } else if (candidate.type() == STUN_PORT_TYPE) {
+    } else if (candidate.is_stun()) {
       // For a srflx candidate, the related address should be set to 0.0.0.0 or
       // ::0
       EXPECT_TRUE(IPIsAny(raddr.ipaddr()));
       EXPECT_EQ(raddr.port(), 0);
       ++num_srflx_candidates;
-    } else if (candidate.type() == RELAY_PORT_TYPE) {
+    } else if (candidate.is_relay()) {
       EXPECT_EQ(kNatUdpAddr.ipaddr(), raddr.ipaddr());
       EXPECT_EQ(kNatUdpAddr.family(), raddr.family());
       ++num_relay_candidates;
diff --git a/pc/jsep_session_description.cc b/pc/jsep_session_description.cc
index 885c1eb..db54dbc 100644
--- a/pc/jsep_session_description.cc
+++ b/pc/jsep_session_description.cc
@@ -26,6 +26,7 @@
 #include "rtc_base/net_helper.h"
 #include "rtc_base/socket_address.h"
 
+using cricket::Candidate;
 using cricket::SessionDescription;
 
 namespace webrtc {
@@ -43,13 +44,13 @@
 constexpr char kDummyAddress[] = "0.0.0.0";
 constexpr int kDummyPort = 9;
 
-int GetCandidatePreferenceFromType(const std::string& type) {
+int GetCandidatePreferenceFromType(const Candidate& c) {
   int preference = kPreferenceUnknown;
-  if (type == cricket::LOCAL_PORT_TYPE) {
+  if (c.is_local()) {
     preference = kPreferenceHost;
-  } else if (type == cricket::STUN_PORT_TYPE) {
+  } else if (c.is_stun()) {
     preference = kPreferenceReflexive;
-  } else if (type == cricket::RELAY_PORT_TYPE) {
+  } else if (c.is_relay()) {
     preference = kPreferenceRelayed;
   } else {
     preference = kPreferenceUnknown;
@@ -78,7 +79,7 @@
       continue;
     }
     const int preference =
-        GetCandidatePreferenceFromType(jsep_candidate->candidate().type());
+        GetCandidatePreferenceFromType(jsep_candidate->candidate());
     const int family = jsep_candidate->candidate().address().ipaddr().family();
     // See if this candidate is more preferable then the current one if it's the
     // same family. Or if the current family is IPv4 already so we could safely
@@ -253,7 +254,7 @@
     return false;
   }
 
-  cricket::Candidate updated_candidate = candidate->candidate();
+  Candidate updated_candidate = candidate->candidate();
   if (updated_candidate.username().empty()) {
     updated_candidate.set_username(transport_info->description.ice_ufrag);
   }
@@ -278,7 +279,7 @@
 }
 
 size_t JsepSessionDescription::RemoveCandidates(
-    const std::vector<cricket::Candidate>& candidates) {
+    const std::vector<Candidate>& candidates) {
   size_t num_removed = 0;
   for (auto& candidate : candidates) {
     int mediasection_index = GetMediasectionIndex(candidate);
@@ -352,8 +353,7 @@
   return true;
 }
 
-int JsepSessionDescription::GetMediasectionIndex(
-    const cricket::Candidate& candidate) {
+int JsepSessionDescription::GetMediasectionIndex(const Candidate& candidate) {
   // Find the description with a matching transport name of the candidate.
   const std::string& transport_name = candidate.transport_name();
   for (size_t i = 0; i < description_->contents().size(); ++i) {
diff --git a/pc/legacy_stats_collector.cc b/pc/legacy_stats_collector.cc
index a6a6945..135829a 100644
--- a/pc/legacy_stats_collector.cc
+++ b/pc/legacy_stats_collector.cc
@@ -496,17 +496,17 @@
 
 }  // namespace
 
-const char* IceCandidateTypeToStatsType(const std::string& candidate_type) {
-  if (candidate_type == cricket::LOCAL_PORT_TYPE) {
+const char* IceCandidateTypeToStatsType(const cricket::Candidate& candidate) {
+  if (candidate.is_local()) {
     return STATSREPORT_LOCAL_PORT_TYPE;
   }
-  if (candidate_type == cricket::STUN_PORT_TYPE) {
+  if (candidate.is_stun()) {
     return STATSREPORT_STUN_PORT_TYPE;
   }
-  if (candidate_type == cricket::PRFLX_PORT_TYPE) {
+  if (candidate.is_prflx()) {
     return STATSREPORT_PRFLX_PORT_TYPE;
   }
-  if (candidate_type == cricket::RELAY_PORT_TYPE) {
+  if (candidate.is_relay()) {
     return STATSREPORT_RELAY_PORT_TYPE;
   }
   RTC_DCHECK_NOTREACHED();
@@ -844,7 +844,7 @@
     report->AddInt(StatsReport::kStatsValueNameCandidatePriority,
                    candidate.priority());
     report->AddString(StatsReport::kStatsValueNameCandidateType,
-                      IceCandidateTypeToStatsType(candidate.type()));
+                      IceCandidateTypeToStatsType(candidate));
     report->AddString(StatsReport::kStatsValueNameCandidateTransportType,
                       candidate.protocol());
   }
diff --git a/pc/legacy_stats_collector.h b/pc/legacy_stats_collector.h
index 1c7aad0..e037163 100644
--- a/pc/legacy_stats_collector.h
+++ b/pc/legacy_stats_collector.h
@@ -26,6 +26,7 @@
 #include <vector>
 
 #include "absl/types/optional.h"
+#include "api/candidate.h"
 #include "api/field_trials_view.h"
 #include "api/legacy_stats_types.h"
 #include "api/media_stream_interface.h"
@@ -45,7 +46,7 @@
 
 // Conversion function to convert candidate type string to the corresponding one
 // from  enum RTCStatsIceCandidateType.
-const char* IceCandidateTypeToStatsType(const std::string& candidate_type);
+const char* IceCandidateTypeToStatsType(const cricket::Candidate& candidate);
 
 // Conversion function to convert adapter type to report string which are more
 // fitting to the general style of http://w3c.github.io/webrtc-stats. This is
diff --git a/pc/legacy_stats_collector_unittest.cc b/pc/legacy_stats_collector_unittest.cc
index 3099d11..5f6140d 100644
--- a/pc/legacy_stats_collector_unittest.cc
+++ b/pc/legacy_stats_collector_unittest.cc
@@ -1391,7 +1391,7 @@
       ExtractStatsValue(StatsReport::kStatsReportTypeIceLocalCandidate, reports,
                         StatsReport::kStatsValueNameCandidatePriority));
   EXPECT_EQ(
-      IceCandidateTypeToStatsType(cricket::LOCAL_PORT_TYPE),
+      IceCandidateTypeToStatsType(local),
       ExtractStatsValue(StatsReport::kStatsReportTypeIceLocalCandidate, reports,
                         StatsReport::kStatsValueNameCandidateType));
   EXPECT_EQ(
@@ -1421,7 +1421,7 @@
                               reports,
                               StatsReport::kStatsValueNameCandidatePriority));
   EXPECT_EQ(
-      IceCandidateTypeToStatsType(cricket::PRFLX_PORT_TYPE),
+      IceCandidateTypeToStatsType(remote),
       ExtractStatsValue(StatsReport::kStatsReportTypeIceRemoteCandidate,
                         reports, StatsReport::kStatsValueNameCandidateType));
   EXPECT_EQ(kNotFound,
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 4555ff1..a5a3067 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -164,14 +164,14 @@
   return sb.str();
 }
 
-const char* CandidateTypeToRTCIceCandidateType(const std::string& type) {
-  if (type == cricket::LOCAL_PORT_TYPE)
+const char* CandidateTypeToRTCIceCandidateType(const cricket::Candidate& c) {
+  if (c.is_local())
     return "host";
-  if (type == cricket::STUN_PORT_TYPE)
+  if (c.is_stun())
     return "srflx";
-  if (type == cricket::PRFLX_PORT_TYPE)
+  if (c.is_prflx())
     return "prflx";
-  if (type == cricket::RELAY_PORT_TYPE)
+  if (c.is_relay())
     return "relay";
   RTC_DCHECK_NOTREACHED();
   return nullptr;
@@ -1001,7 +1001,7 @@
     candidate_stats->port = static_cast<int32_t>(candidate.address().port());
     candidate_stats->protocol = candidate.protocol();
     candidate_stats->candidate_type =
-        CandidateTypeToRTCIceCandidateType(candidate.type());
+        CandidateTypeToRTCIceCandidateType(candidate);
     candidate_stats->priority = static_cast<int32_t>(candidate.priority());
     candidate_stats->foundation = candidate.foundation();
     auto related_address = candidate.related_address();
@@ -2194,14 +2194,4 @@
   }
 }
 
-const char* CandidateTypeToRTCIceCandidateTypeForTesting(
-    const std::string& type) {
-  return CandidateTypeToRTCIceCandidateType(type);
-}
-
-const char* DataStateToRTCDataChannelStateForTesting(
-    DataChannelInterface::DataState state) {
-  return DataStateToRTCDataChannelState(state);
-}
-
 }  // namespace webrtc
diff --git a/pc/rtc_stats_collector.h b/pc/rtc_stats_collector.h
index 4c68e77..505979c 100644
--- a/pc/rtc_stats_collector.h
+++ b/pc/rtc_stats_collector.h
@@ -322,11 +322,6 @@
   InternalRecord internal_record_;
 };
 
-const char* CandidateTypeToRTCIceCandidateTypeForTesting(
-    const std::string& type);
-const char* DataStateToRTCDataChannelStateForTesting(
-    DataChannelInterface::DataState state);
-
 }  // namespace webrtc
 
 #endif  // PC_RTC_STATS_COLLECTOR_H_
diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h
index 6838712..7b3f119 100644
--- a/pc/test/integration_test_helpers.h
+++ b/pc/test/integration_test_helpers.h
@@ -1115,7 +1115,7 @@
     if (remote_async_dns_resolver_) {
       const auto& local_candidate = candidate->candidate();
       if (local_candidate.address().IsUnresolvedIP()) {
-        RTC_DCHECK(local_candidate.type() == cricket::LOCAL_PORT_TYPE);
+        RTC_DCHECK(local_candidate.is_local());
         const auto resolved_ip = mdns_responder_->GetMappedAddressForName(
             local_candidate.address().hostname());
         RTC_DCHECK(!resolved_ip.IsNil());
diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc
index 5e9d5c2..060599b 100644
--- a/pc/webrtc_sdp.cc
+++ b/pc/webrtc_sdp.cc
@@ -771,13 +771,13 @@
 static const int kPreferenceReflexive = 2;
 static const int kPreferenceRelayed = 3;
 
-static int GetCandidatePreferenceFromType(absl::string_view type) {
+static int GetCandidatePreferenceFromType(const Candidate& candidate) {
   int preference = kPreferenceUnknown;
-  if (type == cricket::LOCAL_PORT_TYPE) {
+  if (candidate.is_local()) {
     preference = kPreferenceHost;
-  } else if (type == cricket::STUN_PORT_TYPE) {
+  } else if (candidate.is_stun()) {
     preference = kPreferenceReflexive;
-  } else if (type == cricket::RELAY_PORT_TYPE) {
+  } else if (candidate.is_relay()) {
     preference = kPreferenceRelayed;
   } else {
     RTC_DCHECK_NOTREACHED();
@@ -810,7 +810,7 @@
     if (candidate.protocol() != cricket::UDP_PROTOCOL_NAME) {
       continue;
     }
-    const int preference = GetCandidatePreferenceFromType(candidate.type());
+    const int preference = GetCandidatePreferenceFromType(candidate);
     const int family = candidate.address().ipaddr().family();
     // See if this candidate is more preferable then the current one if it's the
     // same family. Or if the current family is IPv4 already so we could safely
@@ -2005,13 +2005,13 @@
     // *(SP extension-att-name SP extension-att-value)
     std::string type;
     // Map the cricket candidate type to "host" / "srflx" / "prflx" / "relay"
-    if (candidate.type() == cricket::LOCAL_PORT_TYPE) {
+    if (candidate.is_local()) {
       type = kCandidateHost;
-    } else if (candidate.type() == cricket::STUN_PORT_TYPE) {
+    } else if (candidate.is_stun()) {
       type = kCandidateSrflx;
-    } else if (candidate.type() == cricket::RELAY_PORT_TYPE) {
+    } else if (candidate.is_relay()) {
       type = kCandidateRelay;
-    } else if (candidate.type() == cricket::PRFLX_PORT_TYPE) {
+    } else if (candidate.is_prflx()) {
       type = kCandidatePrflx;
       // Peer reflexive candidate may be signaled for being removed.
     } else {
