diff --git a/quic/core/chlo_extractor.cc b/quic/core/chlo_extractor.cc
index 1cf6e14..0430f8d 100644
--- a/quic/core/chlo_extractor.cc
+++ b/quic/core/chlo_extractor.cc
@@ -120,22 +120,10 @@
     const QuicPacketHeader& header) {
   connection_id_ = header.destination_connection_id;
   // QuicFramer creates a NullEncrypter and NullDecrypter at level
-  // ENCRYPTION_INITIAL, which are the correct ones to use with the QUIC Crypto
-  // handshake. When the TLS handshake is used, the IETF-style initial crypters
-  // are used instead, so those need to be created and installed.
-  if (header.version.handshake_protocol == PROTOCOL_TLS1_3) {
-    CrypterPair crypters;
-    CryptoUtils::CreateInitialObfuscators(
-        Perspective::IS_SERVER, header.version,
-        header.destination_connection_id, &crypters);
-    framer_->SetEncrypter(ENCRYPTION_INITIAL, std::move(crypters.encrypter));
-    if (framer_->version().KnowsWhichDecrypterToUse()) {
-      framer_->InstallDecrypter(ENCRYPTION_INITIAL,
-                                std::move(crypters.decrypter));
-    } else {
-      framer_->SetDecrypter(ENCRYPTION_INITIAL, std::move(crypters.decrypter));
-    }
-  }
+  // ENCRYPTION_INITIAL. While those are the correct ones to use with some
+  // versions of QUIC, others use the IETF-style initial crypters, so those need
+  // to be created and installed.
+  framer_->SetInitialObfuscators(header.destination_connection_id);
   return true;
 }
 bool ChloFramerVisitor::OnUnauthenticatedHeader(
diff --git a/quic/core/chlo_extractor_test.cc b/quic/core/chlo_extractor_test.cc
index 806f6dc..4da7810 100644
--- a/quic/core/chlo_extractor_test.cc
+++ b/quic/core/chlo_extractor_test.cc
@@ -70,14 +70,7 @@
     }
     QuicFramer framer(SupportedVersions(header_.version), QuicTime::Zero(),
                       Perspective::IS_CLIENT, kQuicDefaultConnectionIdLength);
-    if (version.handshake_protocol == PROTOCOL_TLS1_3) {
-      CrypterPair crypters;
-      CryptoUtils::CreateInitialObfuscators(Perspective::IS_CLIENT, version,
-                                            TestConnectionId(), &crypters);
-      framer.SetEncrypter(ENCRYPTION_INITIAL, std::move(crypters.encrypter));
-      framer.InstallDecrypter(ENCRYPTION_INITIAL,
-                              std::move(crypters.decrypter));
-    }
+    framer.SetInitialObfuscators(TestConnectionId());
     if (!QuicVersionUsesCryptoFrames(version.transport_version) ||
         munge_stream_id) {
       QuicStreamId stream_id =
diff --git a/quic/core/crypto/crypto_handshake.h b/quic/core/crypto/crypto_handshake.h
index 424727f..ecf81d8 100644
--- a/quic/core/crypto/crypto_handshake.h
+++ b/quic/core/crypto/crypto_handshake.h
@@ -90,7 +90,9 @@
 // A CrypterPair contains the encrypter and decrypter for an encryption level.
 struct QUIC_EXPORT_PRIVATE CrypterPair {
   CrypterPair();
+  CrypterPair(CrypterPair&&) = default;
   ~CrypterPair();
+
   std::unique_ptr<QuicEncrypter> encrypter;
   std::unique_ptr<QuicDecrypter> decrypter;
 };
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc
index 727917b..db6b867 100644
--- a/quic/core/quic_framer.cc
+++ b/quic/core/quic_framer.cc
@@ -4166,6 +4166,14 @@
   encrypter_[level] = std::move(encrypter);
 }
 
+void QuicFramer::SetInitialObfuscators(QuicConnectionId connection_id) {
+  CrypterPair crypters;
+  CryptoUtils::CreateInitialObfuscators(perspective_, version_, connection_id,
+                                        &crypters);
+  encrypter_[ENCRYPTION_INITIAL] = std::move(crypters.encrypter);
+  decrypter_[ENCRYPTION_INITIAL] = std::move(crypters.decrypter);
+}
+
 size_t QuicFramer::EncryptInPlace(EncryptionLevel level,
                                   QuicPacketNumber packet_number,
                                   size_t ad_len,
diff --git a/quic/core/quic_framer.h b/quic/core/quic_framer.h
index f429a83..de026a7 100644
--- a/quic/core/quic_framer.h
+++ b/quic/core/quic_framer.h
@@ -549,6 +549,9 @@
   void SetEncrypter(EncryptionLevel level,
                     std::unique_ptr<QuicEncrypter> encrypter);
 
+  // Sets the encrypter and decrypter for the ENCRYPTION_INITIAL level.
+  void SetInitialObfuscators(QuicConnectionId connection_id);
+
   // Encrypts a payload in |buffer|.  |ad_len| is the length of the associated
   // data. |total_len| is the length of the associated data plus plaintext.
   // |buffer_len| is the full length of the allocated buffer.
diff --git a/quic/test_tools/quic_test_utils.cc b/quic/test_tools/quic_test_utils.cc
index 594f9af..3b71894 100644
--- a/quic/test_tools/quic_test_utils.cc
+++ b/quic/test_tools/quic_test_utils.cc
@@ -899,18 +899,8 @@
   ParsedQuicVersion version = (*versions)[0];
   EncryptionLevel level =
       header.version_flag ? ENCRYPTION_INITIAL : ENCRYPTION_FORWARD_SECURE;
-  if (version.handshake_protocol == PROTOCOL_TLS1_3 &&
-      level == ENCRYPTION_INITIAL) {
-    CrypterPair crypters;
-    CryptoUtils::CreateInitialObfuscators(Perspective::IS_CLIENT, version,
-                                          destination_connection_id, &crypters);
-    framer.SetEncrypter(ENCRYPTION_INITIAL, std::move(crypters.encrypter));
-    if (version.KnowsWhichDecrypterToUse()) {
-      framer.InstallDecrypter(ENCRYPTION_INITIAL,
-                              std::move(crypters.decrypter));
-    } else {
-      framer.SetDecrypter(ENCRYPTION_INITIAL, std::move(crypters.decrypter));
-    }
+  if (level == ENCRYPTION_INITIAL) {
+    framer.SetInitialObfuscators(destination_connection_id);
   }
   if (!QuicVersionUsesCryptoFrames(version.transport_version)) {
     QuicFrame frame(
@@ -987,12 +977,8 @@
   QuicFramer framer(versions != nullptr ? *versions : AllSupportedVersions(),
                     QuicTime::Zero(), perspective,
                     kQuicDefaultConnectionIdLength);
-  if (version.handshake_protocol == PROTOCOL_TLS1_3 && version_flag) {
-    CrypterPair crypters;
-    CryptoUtils::CreateInitialObfuscators(Perspective::IS_CLIENT, version,
-                                          destination_connection_id, &crypters);
-    framer.SetEncrypter(ENCRYPTION_INITIAL, std::move(crypters.encrypter));
-    framer.InstallDecrypter(ENCRYPTION_INITIAL, std::move(crypters.decrypter));
+  if (version_flag) {
+    framer.SetInitialObfuscators(destination_connection_id);
   }
   // We need a minimum of 7 bytes of encrypted payload. This will guarantee that
   // we have at least that much. (It ignores the overhead of the stream/crypto
