diff --git a/fxbarcode/qrcode/BC_QRCoderBitVector.cpp b/fxbarcode/qrcode/BC_QRCoderBitVector.cpp
index 7a41ad0..09dddc3 100644
--- a/fxbarcode/qrcode/BC_QRCoderBitVector.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderBitVector.cpp
@@ -25,15 +25,12 @@
 #include "core/fxcrt/fx_memory.h"
 #include "fxbarcode/utils.h"
 
-CBC_QRCoderBitVector::CBC_QRCoderBitVector() {}
+CBC_QRCoderBitVector::CBC_QRCoderBitVector() = default;
 
-CBC_QRCoderBitVector::~CBC_QRCoderBitVector() {}
+CBC_QRCoderBitVector::~CBC_QRCoderBitVector() = default;
 
-int32_t CBC_QRCoderBitVector::At(size_t index, int32_t& e) const {
-  if (index >= m_sizeInBits) {
-    e = BCExceptionBadIndexException;
-    return 0;
-  }
+int32_t CBC_QRCoderBitVector::At(size_t index) const {
+  CHECK(index < m_sizeInBits);
   int32_t value = m_array[index >> 3] & 0xff;
   return (value >> (7 - (index & 0x7))) & 1;
 }
@@ -73,14 +70,9 @@
   }
 }
 
-void CBC_QRCoderBitVector::AppendBitVector(CBC_QRCoderBitVector* bits) {
-  int32_t size = bits->Size();
-  for (int32_t i = 0; i < size; i++) {
-    int e = BCExceptionNO;
-    int32_t num = bits->At(i, e);
-    ASSERT(e == BCExceptionNO);
-    AppendBit(num);
-  }
+void CBC_QRCoderBitVector::AppendBitVector(const CBC_QRCoderBitVector* bits) {
+  for (size_t i = 0; i < bits->Size(); i++)
+    AppendBit(bits->At(i));
 }
 
 bool CBC_QRCoderBitVector::XOR(const CBC_QRCoderBitVector* other) {
diff --git a/fxbarcode/qrcode/BC_QRCoderBitVector.h b/fxbarcode/qrcode/BC_QRCoderBitVector.h
index 0ebeb60..9b8af81 100644
--- a/fxbarcode/qrcode/BC_QRCoderBitVector.h
+++ b/fxbarcode/qrcode/BC_QRCoderBitVector.h
@@ -18,13 +18,13 @@
   ~CBC_QRCoderBitVector();
 
   const uint8_t* GetArray() const;
-  int32_t At(size_t index, int32_t& e) const;
+  int32_t At(size_t index) const;
   size_t Size() const;
   size_t sizeInBytes() const;
 
   void AppendBit(int32_t bit);
   void AppendBits(int32_t value, int32_t numBits);
-  void AppendBitVector(CBC_QRCoderBitVector* bits);
+  void AppendBitVector(const CBC_QRCoderBitVector* bits);
   bool XOR(const CBC_QRCoderBitVector* other);
 
  private:
diff --git a/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp b/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
index 2a13ade..59d275f 100644
--- a/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
@@ -96,7 +96,7 @@
                    int32_t maskPattern,
                    CBC_CommonByteMatrix* matrix) {
   int32_t e = BCExceptionNO;
-  size_t bitIndex = 0;
+  size_t szBitIndex = 0;
   int32_t direction = -1;
   int32_t x = matrix->GetWidth() - 1;
   int32_t y = matrix->GetHeight() - 1;
@@ -115,11 +115,9 @@
           continue;
         }
         int32_t bit;
-        if (bitIndex < dataBits->Size()) {
-          bit = dataBits->At(bitIndex, e);
-          if (e != BCExceptionNO)
-            return false;
-          bitIndex++;
+        if (szBitIndex < dataBits->Size()) {
+          bit = dataBits->At(szBitIndex);
+          szBitIndex++;
         } else {
           bit = 0;
         }
@@ -139,7 +137,7 @@
     y += direction;
     x -= 2;
   }
-  return bitIndex == dataBits->Size();
+  return szBitIndex == dataBits->Size();
 }
 
 int32_t CalculateBCHCode(int32_t value, int32_t poly) {
@@ -184,11 +182,8 @@
   if (!MakeTypeInfoBits(ecLevel, maskPattern, &typeInfoBits))
     return false;
 
-  int32_t e = BCExceptionNO;
   for (size_t i = 0; i < typeInfoBits.Size(); i++) {
-    int32_t bit = typeInfoBits.At(typeInfoBits.Size() - 1 - i, e);
-    if (e != BCExceptionNO)
-      return false;
+    int32_t bit = typeInfoBits.At(typeInfoBits.Size() - 1 - i);
     int32_t x1 = TYPE_INFO_COORDINATES[i][0];
     int32_t y1 = TYPE_INFO_COORDINATES[i][1];
     matrix->Set(x1, y1, bit);
@@ -205,25 +200,21 @@
   return true;
 }
 
-bool MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix) {
+void MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix) {
   if (version < 7)
-    return true;
+    return;
 
   CBC_QRCoderBitVector versionInfoBits;
   MakeVersionInfoBits(version, &versionInfoBits);
   int32_t bitIndex = 6 * 3 - 1;
-  int32_t e = BCExceptionNO;
   for (int32_t i = 0; i < 6; i++) {
     for (int32_t j = 0; j < 3; j++) {
-      int32_t bit = versionInfoBits.At(bitIndex, e);
-      if (e != BCExceptionNO)
-        return false;
+      int32_t bit = versionInfoBits.At(bitIndex);
       bitIndex--;
       matrix->Set(i, matrix->GetHeight() - 11 + j, bit);
       matrix->Set(matrix->GetHeight() - 11 + j, i, bit);
     }
   }
-  return true;
 }
 
 bool EmbedTimingPatterns(CBC_CommonByteMatrix* matrix) {
@@ -396,9 +387,7 @@
     return false;
   if (!EmbedTypeInfo(ecLevel, maskPattern, matrix))
     return false;
-  if (!MaybeEmbedVersionInfo(version, matrix))
-    return false;
-  if (!EmbedDataBits(dataBits, maskPattern, matrix))
-    return false;
-  return true;
+
+  MaybeEmbedVersionInfo(version, matrix);
+  return EmbedDataBits(dataBits, maskPattern, matrix);
 }
diff --git a/fxbarcode/utils.h b/fxbarcode/utils.h
index 94e7266..7d41e91 100644
--- a/fxbarcode/utils.h
+++ b/fxbarcode/utils.h
@@ -25,7 +25,6 @@
 #define BCExceptionNO 0
 #define BCExceptionIllegalArgument 16
 #define BCExceptionValueMustBeEither0or1 50
-#define BCExceptionBadIndexException 52
 #define BCExceptionInvalidateMaskPattern 68
 #define BCExceptionCharacterNotThisMode 75
 #define BCExceptionGeneric 107
