diff --git a/src/common.hpp b/src/common.hpp
index 93b3e87..3337520 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -56,8 +56,6 @@
    static constexpr bool value = true;
 };
 
-using IsLsaNew = std::function<bool(const ndn::Name&, const std::string&, const uint64_t&)>;
-
 } // namespace nlsr
 
 #endif // NLSR_COMMON_HPP
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 95b656c..d87f4fc 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -118,20 +118,21 @@
   // A router should not try to fetch its own LSA
   if (originRouter != m_confParam.getRouterPrefix()) {
 
-    std::string lsaType = updateName.get(updateName.size()-1).toUri();
+    Lsa::Type lsaType;
+    std::istringstream(updateName.get(updateName.size()-1).toUri()) >> lsaType;
 
     _LOG_DEBUG("Received sync update with higher " << lsaType
                << " sequence number than entry in LSDB");
 
     if (m_isLsaNew(originRouter, lsaType, seqNo)) {
-      if (lsaType == AdjLsa::TYPE_STRING && seqNo != 0 &&
+      if (lsaType == Lsa::Type::ADJACENCY && seqNo != 0 &&
           m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
         _LOG_ERROR("Got an update for adjacency LSA when hyperbolic routing"
                    << " is enabled. Not going to fetch.");
         return;
       }
 
-      if (lsaType == CoordinateLsa::TYPE_STRING && seqNo != 0 &&
+      if (lsaType == Lsa::Type::COORDINATE && seqNo != 0 &&
           m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
         _LOG_ERROR("Got an update for coordinate LSA when link-state"
                    << " is enabled. Not going to fetch.");
@@ -143,7 +144,7 @@
 }
 
 void
-SyncLogicHandler::publishRoutingUpdate(const ndn::Name& type, const uint64_t& seqNo)
+SyncLogicHandler::publishRoutingUpdate(const Lsa::Type& type, const uint64_t& seqNo)
 {
   if (m_syncSocket == nullptr) {
     _LOG_FATAL("Cannot publish routing update; SyncSocket does not exist");
@@ -151,14 +152,19 @@
     BOOST_THROW_EXCEPTION(SyncLogicHandler::Error("Cannot publish routing update; SyncSocket does not exist"));
   }
 
-  if (type == NameLsa::TYPE_STRING) {
-    publishSyncUpdate(m_nameLsaUserPrefix, seqNo);
-  }
-  else if (type == AdjLsa::TYPE_STRING) {
+
+  switch (type) {
+  case Lsa::Type::ADJACENCY:
     publishSyncUpdate(m_adjLsaUserPrefix, seqNo);
-  }
-  else {
+    break;
+  case Lsa::Type::COORDINATE:
     publishSyncUpdate(m_coorLsaUserPrefix, seqNo);
+    break;
+  case Lsa::Type::NAME:
+    publishSyncUpdate(m_nameLsaUserPrefix, seqNo);
+    break;
+  default:
+    break;
   }
 }
 
@@ -170,13 +176,13 @@
   updatePrefix.append(m_confParam.getRouterName());
 
   m_nameLsaUserPrefix = updatePrefix;
-  m_nameLsaUserPrefix.append(NameLsa::TYPE_STRING);
+  m_nameLsaUserPrefix.append(std::to_string(Lsa::Type::NAME));
 
   m_adjLsaUserPrefix = updatePrefix;
-  m_adjLsaUserPrefix.append(AdjLsa::TYPE_STRING);
+  m_adjLsaUserPrefix.append(std::to_string(Lsa::Type::ADJACENCY));
 
   m_coorLsaUserPrefix = updatePrefix;
-  m_coorLsaUserPrefix.append(CoordinateLsa::TYPE_STRING);
+  m_coorLsaUserPrefix.append(std::to_string(Lsa::Type::COORDINATE));
 }
 
 void
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index afa1464..3a074ef 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -24,6 +24,7 @@
 
 #include "test-access-control.hpp"
 #include "signals.hpp"
+#include "lsa.hpp"
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/util/signal.hpp>
@@ -48,7 +49,7 @@
 {
 public:
   using IsLsaNew =
-    std::function<bool(const ndn::Name&, const std::string& lsaType, const uint64_t&)>;
+    std::function<bool(const ndn::Name&, const Lsa::Type& lsaType, const uint64_t&)>;
 
   class Error : public std::runtime_error
   {
@@ -83,7 +84,7 @@
    * \sa publishSyncUpdate
    */
   void
-  publishRoutingUpdate(const ndn::Name& type, const uint64_t& seqNo);
+  publishRoutingUpdate(const Lsa::Type& type, const uint64_t& seqNo);
 
   /*! \brief Create and configure a socket to enable ChronoSync for this NLSR.
    *
diff --git a/src/lsa.cpp b/src/lsa.cpp
index ec27a35..1b5e804 100644
--- a/src/lsa.cpp
+++ b/src/lsa.cpp
@@ -38,22 +38,17 @@
 
 INIT_LOGGER("Lsa");
 
-const std::string NameLsa::TYPE_STRING = "name";
-const std::string AdjLsa::TYPE_STRING = "adjacency";
-const std::string CoordinateLsa::TYPE_STRING = "coordinate";
-
 const ndn::Name
 NameLsa::getKey() const
 {
   ndn::Name key = m_origRouter;
-  key.append(NameLsa::TYPE_STRING);
+  key.append(std::to_string(Lsa::Type::NAME));
   return key;
 }
 
 NameLsa::NameLsa(const ndn::Name& origR, uint32_t lsn,
                  const ndn::time::system_clock::TimePoint& lt,
                  NamePrefixList& npl)
-  : Lsa(NameLsa::TYPE_STRING)
 {
   m_origRouter = origR;
   m_lsSeqNo = lsn;
@@ -67,7 +62,7 @@
 NameLsa::getData()
 {
   std::ostringstream os;
-  os << m_origRouter << "|" << NameLsa::TYPE_STRING << "|" << m_lsSeqNo << "|"
+  os << m_origRouter << "|" << Lsa::Type::NAME << "|" << m_lsSeqNo << "|"
      << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_npl.size();
   for (const auto& name : m_npl.getNames()) {
     os << "|" << name;
@@ -89,7 +84,7 @@
     return false;
   }
   try {
-    if (*tok_iter++ != NameLsa::TYPE_STRING) {
+    if (*tok_iter++ != std::to_string(Lsa::Type::NAME)) {
       return false;
     }
 
@@ -119,7 +114,7 @@
 {
   _LOG_DEBUG("Name Lsa: ");
   _LOG_DEBUG("  Origination Router: " << m_origRouter);
-  _LOG_DEBUG("  Ls Type: " << m_lsType);
+  _LOG_DEBUG("  Ls Type: " << getType());
   _LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
   _LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
   _LOG_DEBUG("  Names: ");
@@ -135,7 +130,6 @@
 CoordinateLsa::CoordinateLsa(const ndn::Name& origR, uint32_t lsn,
                              const ndn::time::system_clock::TimePoint& lt,
                              double r, std::vector<double> theta)
-  : Lsa(CoordinateLsa::TYPE_STRING)
 {
   m_origRouter = origR;
   m_lsSeqNo = lsn;
@@ -148,7 +142,7 @@
 CoordinateLsa::getKey() const
 {
   ndn::Name key = m_origRouter;
-  key.append(CoordinateLsa::TYPE_STRING);
+  key.append(std::to_string(Lsa::Type::COORDINATE));
   return key;
 }
 
@@ -174,7 +168,7 @@
 CoordinateLsa::getData()
 {
   std::ostringstream os;
-  os << m_origRouter << "|" << CoordinateLsa::TYPE_STRING << "|" << m_lsSeqNo << "|"
+  os << m_origRouter << "|" << Lsa::Type::COORDINATE << "|" << m_lsSeqNo << "|"
      << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_corRad << "|"
      << m_angles.size() << "|";
 
@@ -198,7 +192,7 @@
   }
 
   try {
-    if (*tok_iter++ != CoordinateLsa::TYPE_STRING) {
+    if (*tok_iter++ != std::to_string(Lsa::Type::COORDINATE)) {
       return false;
     }
 
@@ -223,7 +217,7 @@
 {
   _LOG_DEBUG("Cor Lsa: ");
   _LOG_DEBUG("  Origination Router: " << m_origRouter);
-  _LOG_DEBUG("  Ls Type: " << m_lsType);
+  _LOG_DEBUG("  Ls Type: " << getType());
   _LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
   _LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
   _LOG_DEBUG("    Hyperbolic Radius: " << m_corRad);
@@ -236,7 +230,6 @@
 AdjLsa::AdjLsa(const ndn::Name& origR, uint32_t lsn,
                const ndn::time::system_clock::TimePoint& lt,
                uint32_t nl , AdjacencyList& adl)
-  : Lsa(AdjLsa::TYPE_STRING)
 {
   m_origRouter = origR;
   m_lsSeqNo = lsn;
@@ -254,7 +247,7 @@
 AdjLsa::getKey() const
 {
   ndn::Name key = m_origRouter;
-  key.append(AdjLsa::TYPE_STRING);
+  key.append(std::to_string(Lsa::Type::ADJACENCY));
   return key;
 }
 
@@ -268,7 +261,7 @@
 AdjLsa::getData()
 {
   std::ostringstream os;
-  os << m_origRouter << "|" << AdjLsa::TYPE_STRING << "|" << m_lsSeqNo << "|"
+  os << m_origRouter << "|" << Lsa::Type::ADJACENCY << "|" << m_lsSeqNo << "|"
      << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_adl.size();
   for (const auto& adjacent : m_adl.getAdjList()) {
     os << "|" << adjacent.getName() << "|" << adjacent.getFaceUri()
@@ -291,7 +284,7 @@
     return false;
   }
   try {
-    if (*tok_iter++ != AdjLsa::TYPE_STRING) {
+    if (*tok_iter++ != std::to_string(Lsa::Type::ADJACENCY)) {
       return false;
     }
 
@@ -351,7 +344,7 @@
 {
   os << "Adj Lsa:\n"
      << "  Origination Router: " << adjLsa.getOrigRouter() << "\n"
-     << "  Ls Type: " << adjLsa.getLsType() << "\n"
+     << "  Ls Type: " << adjLsa.getType() << "\n"
      << "  Ls Seq No: " << adjLsa.getLsSeqNo() << "\n"
      << "  Ls Lifetime: " << adjLsa.getExpirationTimePoint() << "\n"
      << "  Adjacents: \n";
@@ -369,4 +362,49 @@
   return os;
 }
 
+std::ostream&
+operator<<(std::ostream& os, const Lsa::Type& type)
+{
+  os << std::to_string(type);
+  return os;
+}
+
+std::istream&
+operator>>(std::istream& is, Lsa::Type& type)
+{
+  std::string typeString;
+  is >> typeString;
+  if (typeString == "ADJACENCY") {
+    type = Lsa::Type::ADJACENCY;
+  }
+  else if (typeString == "COORDINATE") {
+    type = Lsa::Type::COORDINATE;
+  }
+  else if (typeString == "NAME") {
+    type = Lsa::Type::NAME;
+  }
+  else {
+    type = Lsa::Type::BASE;
+  }
+  return is;
+}
+
 } // namespace nlsr
+
+namespace std {
+std::string
+to_string(const nlsr::Lsa::Type& type)
+{
+  switch (type) {
+  case nlsr::Lsa::Type::ADJACENCY:
+     return "ADJACENCY";
+  case nlsr::Lsa::Type::COORDINATE:
+    return "COORDINATE";
+  case nlsr::Lsa::Type::NAME:
+    return "NAME";
+  default:
+    return "BASE";
+  }
+}
+
+} // namespace std
diff --git a/src/lsa.hpp b/src/lsa.hpp
index d27ddd6..dd69d8e 100644
--- a/src/lsa.hpp
+++ b/src/lsa.hpp
@@ -37,19 +37,25 @@
 class Lsa
 {
 public:
-  Lsa(const std::string& lsaType)
+  enum class Type {
+    ADJACENCY,
+    COORDINATE,
+    NAME,
+    BASE
+  };
+
+  Lsa()
     : m_origRouter()
-    , m_lsType(lsaType)
     , m_lsSeqNo()
     , m_expirationTimePoint()
     , m_expiringEventId()
   {
   }
 
-  const std::string&
-  getLsType() const
+  virtual Type
+  getType() const
   {
-    return m_lsType;
+    return Type::BASE;
   }
 
   void
@@ -102,7 +108,6 @@
 
 protected:
   ndn::Name m_origRouter;
-  const std::string m_lsType;
   uint32_t m_lsSeqNo;
   ndn::time::system_clock::TimePoint m_expirationTimePoint;
   ndn::EventId m_expiringEventId;
@@ -112,8 +117,6 @@
 {
 public:
   NameLsa()
-    : Lsa(NameLsa::TYPE_STRING)
-    , m_npl()
   {
   }
 
@@ -121,6 +124,12 @@
           const ndn::time::system_clock::TimePoint& lt,
           NamePrefixList& npl);
 
+  Lsa::Type
+  getType() const override
+  {
+    return Lsa::Type::NAME;
+  }
+
   NamePrefixList&
   getNpl()
   {
@@ -180,8 +189,6 @@
 
 private:
   NamePrefixList m_npl;
-public:
-  static const std::string TYPE_STRING;
 };
 
 class AdjLsa: public Lsa
@@ -190,8 +197,6 @@
   typedef AdjacencyList::const_iterator const_iterator;
 
   AdjLsa()
-    : Lsa(AdjLsa::TYPE_STRING)
-    , m_adl()
   {
   }
 
@@ -199,6 +204,12 @@
          const ndn::time::system_clock::TimePoint& lt,
          uint32_t nl , AdjacencyList& adl);
 
+  Lsa::Type
+  getType() const override
+  {
+    return Lsa::Type::ADJACENCY;
+  }
+
   AdjacencyList&
   getAdl()
   {
@@ -277,17 +288,13 @@
 private:
   uint32_t m_noLink;
   AdjacencyList m_adl;
-
-public:
-  static const std::string TYPE_STRING;
 };
 
 class CoordinateLsa: public Lsa
 {
 public:
   CoordinateLsa()
-    : Lsa(CoordinateLsa::TYPE_STRING)
-    , m_corRad(0)
+    : m_corRad(0)
   {
   }
 
@@ -295,6 +302,12 @@
                 const ndn::time::system_clock::TimePoint& lt,
                 double r, std::vector<double> theta);
 
+  Lsa::Type
+  getType() const override
+  {
+    return Lsa::Type::COORDINATE;
+  }
+
   const ndn::Name
   getKey() const;
 
@@ -350,14 +363,22 @@
 private:
   double m_corRad;
   std::vector<double> m_angles;
-
-public:
-  static const std::string TYPE_STRING;
 };
 
 std::ostream&
 operator<<(std::ostream& os, const AdjLsa& adjLsa);
 
+std::ostream&
+operator<<(std::ostream& os, const Lsa::Type& type);
+
+std::istream&
+operator>>(std::istream& is, Lsa::Type& type);
+
 } // namespace nlsr
 
+namespace std {
+  std::string
+  to_string(const nlsr::Lsa::Type& type);
+} // namespace std
+
 #endif // NLSR_LSA_HPP
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 480248e..2661813 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -66,7 +66,7 @@
   : m_nlsr(nlsr)
   , m_scheduler(scheduler)
   , m_sync(m_nlsr.getNlsrFace(),
-           [this] (const ndn::Name& routerName, const std::string& lsaType,
+           [this] (const ndn::Name& routerName, const Lsa::Type& lsaType,
                    const uint64_t& sequenceNumber) {
              return isLsaNew(routerName, lsaType, sequenceNumber);
            }, m_nlsr.getConfParameter())
@@ -166,7 +166,7 @@
   m_sequencingManager.increaseNameLsaSeq();
 
   m_sequencingManager.writeSeqNoToFile();
-  m_sync.publishRoutingUpdate(NameLsa::TYPE_STRING, m_sequencingManager.getNameLsaSeq());
+  m_sync.publishRoutingUpdate(Lsa::Type::NAME, m_sequencingManager.getNameLsaSeq());
 
   return installNameLsa(nameLsa);
 }
@@ -396,7 +396,7 @@
   if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
     m_sequencingManager.increaseCorLsaSeq();
     m_sequencingManager.writeSeqNoToFile();
-    m_sync.publishRoutingUpdate(CoordinateLsa::TYPE_STRING, m_sequencingManager.getCorLsaSeq());
+    m_sync.publishRoutingUpdate(Lsa::Type::COORDINATE, m_sequencingManager.getCorLsaSeq());
   }
 
   installCoordinateLsa(corLsa);
@@ -628,7 +628,7 @@
         _LOG_DEBUG("Removing own Adj LSA; no ACTIVE neighbors");
         // Get this router's key
         ndn::Name key = m_nlsr.getConfParameter().getRouterPrefix();
-        key.append(AdjLsa::TYPE_STRING);
+        key.append(std::to_string(Lsa::Type::ADJACENCY));
 
         removeAdjLsa(key);
         // Recompute routing table after removal
@@ -770,7 +770,7 @@
   if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_ON) {
     m_sequencingManager.increaseAdjLsaSeq();
     m_sequencingManager.writeSeqNoToFile();
-    m_sync.publishRoutingUpdate(AdjLsa::TYPE_STRING, m_sequencingManager.getAdjLsaSeq());
+    m_sync.publishRoutingUpdate(Lsa::Type::ADJACENCY, m_sequencingManager.getAdjLsaSeq());
   }
 
   return installAdjLsa(adjLsa);
@@ -854,7 +854,7 @@
                                                                  chkNameLsa->getLsSeqNo(),
                                                                  m_lsaRefreshTime));
         m_sequencingManager.writeSeqNoToFile();
-        m_sync.publishRoutingUpdate(NameLsa::TYPE_STRING, m_sequencingManager.getNameLsaSeq());
+        m_sync.publishRoutingUpdate(Lsa::Type::NAME, m_sequencingManager.getNameLsaSeq());
       }
       // Since we cannot refresh other router's LSAs, our only choice is to expire.
       else {
@@ -898,7 +898,7 @@
                                                                chkAdjLsa->getLsSeqNo(),
                                                                m_lsaRefreshTime));
         m_sequencingManager.writeSeqNoToFile();
-        m_sync.publishRoutingUpdate(AdjLsa::TYPE_STRING, m_sequencingManager.getAdjLsaSeq());
+        m_sync.publishRoutingUpdate(Lsa::Type::ADJACENCY, m_sequencingManager.getAdjLsaSeq());
       }
       // An LSA from another router is expiring
       else {
@@ -951,7 +951,7 @@
         // Only sync coordinate LSAs if link-state routing is disabled
         if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
           m_sequencingManager.writeSeqNoToFile();
-          m_sync.publishRoutingUpdate(CoordinateLsa::TYPE_STRING, m_sequencingManager.getCorLsaSeq());
+          m_sync.publishRoutingUpdate(Lsa::Type::COORDINATE, m_sequencingManager.getCorLsaSeq());
         }
       }
       // We can't refresh other router's LSAs, so we remove it.
@@ -1004,18 +1004,20 @@
                                    std::bind(&Lsdb::onFetchLsaError, this, _1, _2, interestName,
                                              timeoutCount, deadline, lsaName, seqNo));
   // increment a specific SENT_LSA_INTEREST
-  std::string typeLSA = interestName[-2].toUri();
-  if (typeLSA == AdjLsa::TYPE_STRING) {
+  Lsa::Type lsaType;
+  std::istringstream(interestName[-2].toUri()) >> lsaType;
+  switch (lsaType) {
+  case Lsa::Type::ADJACENCY:
     lsaIncrementSignal(Statistics::PacketType::SENT_ADJ_LSA_INTEREST);
-  }
-  else if (typeLSA == CoordinateLsa::TYPE_STRING) {
+    break;
+  case Lsa::Type::COORDINATE:
     lsaIncrementSignal(Statistics::PacketType::SENT_COORD_LSA_INTEREST);
-  }
-  else if (typeLSA == NameLsa::TYPE_STRING) {
+    break;
+  case Lsa::Type::NAME:
     lsaIncrementSignal(Statistics::PacketType::SENT_NAME_LSA_INTEREST);
-  }
-  else {
-    _LOG_ERROR("typeLSA " + typeLSA + " not recognized; failed Statistics::PacketType conversion");
+    break;
+  default:
+    _LOG_ERROR("lsaType " << lsaType << " not recognized; failed Statistics::PacketType conversion");
   }
 }
 
@@ -1041,16 +1043,20 @@
     uint64_t seqNo = interestName[-1].toNumber();
     _LOG_DEBUG("LSA sequence number from interest: " << seqNo);
 
-    std::string interestedLsType = interestName[-2].toUri();
+    Lsa::Type interestedLsType;
+    std::istringstream(interestName[-2].toUri()) >> interestedLsType;
 
-    if (interestedLsType == NameLsa::TYPE_STRING) {
-      processInterestForNameLsa(interest, originRouter.append(interestedLsType), seqNo);
+    if (interestedLsType == Lsa::Type::NAME) {
+      processInterestForNameLsa(interest, originRouter.append(std::to_string(interestedLsType)),
+                                seqNo);
     }
-    else if (interestedLsType == AdjLsa::TYPE_STRING) {
-      processInterestForAdjacencyLsa(interest, originRouter.append(interestedLsType), seqNo);
+    else if (interestedLsType == Lsa::Type::ADJACENCY) {
+      processInterestForAdjacencyLsa(interest, originRouter.append(std::to_string(interestedLsType)),
+                                     seqNo);
     }
-    else if (interestedLsType == CoordinateLsa::TYPE_STRING) {
-      processInterestForCoordinateLsa(interest, originRouter.append(interestedLsType), seqNo);
+    else if (interestedLsType == Lsa::Type::COORDINATE) {
+      processInterestForCoordinateLsa(interest, originRouter.append(std::to_string(interestedLsType)),
+                                      seqNo);
     }
     else {
       _LOG_WARN("Received unrecognized LSA type: " << interestedLsType);
@@ -1192,16 +1198,20 @@
     std::string dataContent(reinterpret_cast<const char*>(data->getContent().value()),
                             data->getContent().value_size());
 
-    std::string interestedLsType  = dataName[-2].toUri();
+    Lsa::Type interestedLsType;
+    std::istringstream(dataName[-2].toUri()) >> interestedLsType;
 
-    if (interestedLsType == NameLsa::TYPE_STRING) {
-      processContentNameLsa(originRouter.append(interestedLsType), seqNo, dataContent);
+    if (interestedLsType == Lsa::Type::NAME) {
+      processContentNameLsa(originRouter.append(std::to_string(interestedLsType)), seqNo,
+                            dataContent);
     }
-    else if (interestedLsType == AdjLsa::TYPE_STRING) {
-      processContentAdjacencyLsa(originRouter.append(interestedLsType), seqNo, dataContent);
+    else if (interestedLsType == Lsa::Type::ADJACENCY) {
+      processContentAdjacencyLsa(originRouter.append(std::to_string(interestedLsType)), seqNo,
+                                 dataContent);
     }
-    else if (interestedLsType == CoordinateLsa::TYPE_STRING) {
-      processContentCoordinateLsa(originRouter.append(interestedLsType), seqNo, dataContent);
+    else if (interestedLsType == Lsa::Type::COORDINATE) {
+      processContentCoordinateLsa(originRouter.append(std::to_string(interestedLsType)), seqNo,
+                                  dataContent);
     }
     else {
       _LOG_WARN("Received unrecognized LSA Type: " << interestedLsType);
@@ -1284,36 +1294,34 @@
 
 //-----utility function -----
 bool
-Lsdb::doesLsaExist(const ndn::Name& key, const std::string& lsType)
+Lsdb::doesLsaExist(const ndn::Name& key, const Lsa::Type& lsType)
 {
-  if (lsType == NameLsa::TYPE_STRING) {
-    return doesNameLsaExist(key);
-  }
-  else if (lsType == AdjLsa::TYPE_STRING) {
+  switch (lsType) {
+  case Lsa::Type::ADJACENCY:
     return doesAdjLsaExist(key);
-  }
-  else if (lsType == CoordinateLsa::TYPE_STRING) {
+  case Lsa::Type::COORDINATE:
     return doesCoordinateLsaExist(key);
+  case Lsa::Type::NAME:
+    return doesNameLsaExist(key);
+  default:
+    return false;
   }
-  return false;
 }
 
 bool
-Lsdb::isLsaNew(const ndn::Name& routerName, const std::string& lsaType,
+Lsdb::isLsaNew(const ndn::Name& routerName, const Lsa::Type& lsaType,
                const uint64_t& sequenceNumber) {
   ndn::Name lsaKey = routerName;
-  lsaKey.append(lsaType);
+  lsaKey.append(std::to_string(lsaType));
 
-  if (lsaType == NameLsa::TYPE_STRING) {
-    return isNameLsaNew(lsaKey, sequenceNumber);
-  }
-  else if (lsaType == AdjLsa::TYPE_STRING) {
+  switch (lsaType) {
+  case Lsa::Type::ADJACENCY:
     return isAdjLsaNew(lsaKey, sequenceNumber);
-  }
-  else if (lsaType == CoordinateLsa::TYPE_STRING) {
+  case Lsa::Type::COORDINATE:
     return isCoordinateLsaNew(lsaKey, sequenceNumber);
-  }
-  else {
+  case Lsa::Type::NAME:
+    return isNameLsaNew(lsaKey, sequenceNumber);
+  default:
     return false;
   }
 }
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 3a63e68..9fd76b7 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -51,10 +51,10 @@
   }
 
   bool
-  isLsaNew(const ndn::Name& routerName, const std::string& lsaType, const uint64_t& sequenceNumber);
+  isLsaNew(const ndn::Name& routerName, const Lsa::Type& lsaType, const uint64_t& sequenceNumber);
 
   bool
-  doesLsaExist(const ndn::Name& key, const std::string& lsType);
+  doesLsaExist(const ndn::Name& key, const Lsa::Type& lsType);
 
   /*! \brief Builds a name LSA for this router and then installs it
       into the LSDB.
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 318ec64..c5f8e09 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -472,12 +472,12 @@
   double distance = UNKNOWN_DISTANCE;
 
   ndn::Name srcLsaKey = src;
-  srcLsaKey.append("coordinate");
+  srcLsaKey.append(std::to_string(Lsa::Type::COORDINATE));
 
   CoordinateLsa* srcLsa = lsdb.findCoordinateLsa(srcLsaKey);
 
   ndn::Name destLsaKey = dest;
-  destLsaKey.append("coordinate");
+  destLsaKey.append(std::to_string(Lsa::Type::COORDINATE));
 
   CoordinateLsa* destLsa = lsdb.findCoordinateLsa(destLsaKey);
 
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 0f31885..a414e8a 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -58,14 +58,14 @@
     if ((!isHrEnabled
          &&
          pnlsr.getLsdb()
-         .doesLsaExist(pnlsr.getConfParameter().getRouterPrefix().toUri()
-                       + "/" + "adjacency", std::string("adjacency")))
+         .doesLsaExist(ndn::Name{pnlsr.getConfParameter().getRouterPrefix()}
+                       .append(std::to_string(Lsa::Type::ADJACENCY)), Lsa::Type::ADJACENCY))
         ||
         (isHrEnabled
          &&
          pnlsr.getLsdb()
-         .doesLsaExist(pnlsr.getConfParameter().getRouterPrefix().toUri()
-                       + "/" + "coordinate", std::string("coordinate")))) {
+         .doesLsaExist(ndn::Name{pnlsr.getConfParameter().getRouterPrefix()}
+                       .append(std::to_string(Lsa::Type::COORDINATE)), Lsa::Type::COORDINATE))) {
       if (pnlsr.getIsBuildAdjLsaSheduled() != 1) {
         _LOG_TRACE("Clearing old routing table");
         clearRoutingTable();
