diff --git a/src/data.cpp b/src/data.cpp
index f72673f..e6104c9 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -309,20 +309,6 @@
   return *this;
 }
 
-name::Component
-Data::getFinalBlockId() const
-{
-  return m_metaInfo.getFinalBlockId();
-}
-
-Data&
-Data::setFinalBlockId(const name::Component& finalBlockId)
-{
-  resetWire();
-  m_metaInfo.setFinalBlockId(finalBlockId);
-  return *this;
-}
-
 bool
 operator==(const Data& lhs, const Data& rhs)
 {
diff --git a/src/data.hpp b/src/data.hpp
index 9541d6b..554c056 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -227,20 +227,6 @@
   Data&
   setFinalBlock(optional<name::Component> finalBlockId);
 
-  /** @deprecated Use @c getFinalBlock
-   *  @sa MetaInfo::getFinalBlockId
-   */
-  [[deprecated("use getFinalBlock")]]
-  name::Component
-  getFinalBlockId() const;
-
-  /** @deprecated Use @c setFinalBlock
-   *  @sa MetaInfo::setFinalBlockId
-   */
-  [[deprecated("use setFinalBlock")]]
-  Data&
-  setFinalBlockId(const name::Component& finalBlockId);
-
 protected:
   /** @brief Clear wire encoding and cached FullName
    *  @note This does not clear the SignatureValue.
diff --git a/src/meta-info.cpp b/src/meta-info.cpp
index f46784c..0c4852c 100644
--- a/src/meta-info.cpp
+++ b/src/meta-info.cpp
@@ -70,15 +70,6 @@
   return *this;
 }
 
-MetaInfo&
-MetaInfo::setFinalBlockId(const name::Component& finalBlockId)
-{
-  if (finalBlockId.isGeneric() && finalBlockId.empty()) {
-    return setFinalBlock(nullopt);
-  }
-  return setFinalBlock(finalBlockId);
-}
-
 const std::list<Block>&
 MetaInfo::getAppMetaInfo() const
 {
diff --git a/src/meta-info.hpp b/src/meta-info.hpp
index 53ff8b9..610d113 100644
--- a/src/meta-info.hpp
+++ b/src/meta-info.hpp
@@ -128,29 +128,6 @@
   MetaInfo&
   setFinalBlock(optional<name::Component> finalBlockId);
 
-  /** @brief return FinalBlockId
-   *  @deprecated use @c getFinalBlock
-   *
-   *  If FinalBlockId element is omitted, returns a default-constructed @c name::Component.
-   *  This is indistinguishable from having an empty GenericNameComponent as FinalBlockId.
-   */
-  [[deprecated("use getFinalBlock")]]
-  name::Component
-  getFinalBlockId() const
-  {
-    return getFinalBlock().value_or(name::Component());
-  }
-
-  /** @brief set FinalBlockId
-   *  @deprecated use @c setFinalBlock
-   *
-   *  Passing a default-constructed @c name::Component removes FinalBlockId element.
-   *  This API does not support adding an empty GenericNameComponent as FinalBlockId.
-   */
-  [[deprecated("use setFinalBlock")]]
-  MetaInfo&
-  setFinalBlockId(const name::Component& finalBlockId);
-
 public: // app-defined MetaInfo items
   /**
    * @brief Get all app-defined MetaInfo items
diff --git a/tests/unit-tests/meta-info.t.cpp b/tests/unit-tests/meta-info.t.cpp
index 57371c3..2a2dac3 100644
--- a/tests/unit-tests/meta-info.t.cpp
+++ b/tests/unit-tests/meta-info.t.cpp
@@ -37,7 +37,6 @@
   BOOST_CHECK_EQUAL(a.getType(), tlv::ContentType_Blob);
   BOOST_CHECK_EQUAL(a.getFreshnessPeriod(), 0_ms);
   BOOST_CHECK(!a.getFinalBlock());
-  BOOST_CHECK_EQUAL(a.getFinalBlockId(), name::Component());
   BOOST_CHECK_EQUAL(a, a);
 
   MetaInfo b;
@@ -54,12 +53,11 @@
   BOOST_CHECK_EQUAL(a.getType(), tlv::ContentType_Link);
   BOOST_CHECK_EQUAL(a.getFreshnessPeriod(), 26290_ms);
   BOOST_CHECK_EQUAL(*a.getFinalBlock(), name::Component("A"));
-  BOOST_CHECK_EQUAL(a.getFinalBlockId(), name::Component("A"));
   BOOST_CHECK_NE(a, b);
 
   b.setType(a.getType());
   b.setFreshnessPeriod(a.getFreshnessPeriod());
-  b.setFinalBlockId(a.getFinalBlockId());
+  b.setFinalBlock(a.getFinalBlock());
   BOOST_CHECK_EQUAL(b.wireEncode(), wire2);
   BOOST_CHECK_EQUAL(a, b);
 
@@ -73,7 +71,7 @@
 
   b.setType(a.getType());
   b.setFreshnessPeriod(a.getFreshnessPeriod());
-  b.setFinalBlockId(a.getFinalBlockId());
+  b.setFinalBlock(a.getFinalBlock());
   BOOST_CHECK_EQUAL(b.wireEncode(), wire3);
   BOOST_CHECK_EQUAL(a, b);
 }
@@ -89,7 +87,7 @@
   std::string ss[5] = {"h", "hello", "hello, world", "hello, world, alex",
                        "hello, world, alex, I am Xiaoke Jiang"};
 
-  for (int i = 0; i < 5; i++) {
+  for (size_t i = 0; i < 5; i++) {
     uint32_t type = 128 + i * 10;
     info1.addAppMetaInfo(makeNonNegativeIntegerBlock(type, ints[i]));
     type += 5;
@@ -116,7 +114,6 @@
   // for (Buffer::const_iterator it = wire.begin(); it != wire.end(); ++it) {
   //   printf("0x%02x, ", *it);
   // }
-
   const uint8_t METAINFO[] = {0x14, 0x77, 0x18, 0x01, 0xc4, 0x19, 0x02, 0x0e, 0x10, 0x1a, 0x0c,
                               0x08, 0x0a, 0x2f, 0x61, 0x74, 0x74, 0x2f, 0x66, 0x69, 0x6e, 0x61,
                               0x6c, 0x80, 0x01, 0x80, 0x85, 0x01, 0x68, 0x8a, 0x01, 0x81, 0x8f,
@@ -135,18 +132,17 @@
   MetaInfo info2;
   info2.wireDecode(Block(METAINFO, sizeof(METAINFO)));
 
-  for (int i = 0; i < 5; i++) {
+  for (size_t i = 0; i < 5; i++) {
     uint32_t tlvType = 128 + i * 10;
     const Block* block = info2.findAppMetaInfo(tlvType);
-    BOOST_REQUIRE(block != 0);
+    BOOST_REQUIRE(block != nullptr);
     BOOST_CHECK_EQUAL(readNonNegativeInteger(*block), ints[i]);
     tlvType += 5;
 
     block = info2.findAppMetaInfo(tlvType);
-    BOOST_REQUIRE(block != 0);
+    BOOST_REQUIRE(block != nullptr);
 
-    std::string s3 = std::string(reinterpret_cast<const char*>(block->value()),
-                                 block->value_size());
+    std::string s3(reinterpret_cast<const char*>(block->value()), block->value_size());
     BOOST_CHECK_EQUAL(s3, ss[i]);
   }
 }
