diff --git a/src/sequencing-manager.cpp b/src/sequencing-manager.cpp
index bae9e68..c7c6c7e 100644
--- a/src/sequencing-manager.cpp
+++ b/src/sequencing-manager.cpp
@@ -34,11 +34,8 @@
 
 INIT_LOGGER(SequencingManager);
 
-SequencingManager::SequencingManager(std::string filePath, int hypState)
-  : m_nameLsaSeq(0)
-  , m_adjLsaSeq(0)
-  , m_corLsaSeq(0)
-  , m_hyperbolicState(hypState)
+SequencingManager::SequencingManager(const std::string& filePath, int hypState)
+  : m_hyperbolicState(hypState)
 {
   setSeqFileDirectory(filePath);
   initiateSeqNoFromFile();
@@ -63,44 +60,24 @@
   NLSR_LOG_DEBUG("Seq File Name: " << m_seqFileNameWithPath);
   std::ifstream inputFile(m_seqFileNameWithPath.c_str());
 
+  std::string seqType;
   // Good checks that file is not (bad or eof or fail)
   if (inputFile.good()) {
-    std::string lsaOrCombinedSeqNo;
-    uint64_t seqNo = 0;
-
-    // If file has a combined seq number, lsaOrCombinedSeqNo would hold it
-    // and seqNo will be zero everytime
-    inputFile >> lsaOrCombinedSeqNo >> seqNo;
-    m_nameLsaSeq = seqNo;
-
-    inputFile >> lsaOrCombinedSeqNo >> seqNo;
-    m_adjLsaSeq = seqNo;
-
-    inputFile >> lsaOrCombinedSeqNo >> seqNo;
-    m_corLsaSeq = seqNo;
-
-    // File was in old format and had a combined sequence number
-    // if all of the seqNo should are still zero and
-    // lsaOrCombinedSeqNo != CorLsaSeq
-    if (m_nameLsaSeq == 0 && m_adjLsaSeq == 0 && m_corLsaSeq == 0 &&
-        lsaOrCombinedSeqNo != "CorLsaSeq") {
-      NLSR_LOG_DEBUG("Old file had combined sequence number: " << lsaOrCombinedSeqNo);
-      std::istringstream iss(lsaOrCombinedSeqNo);
-      iss >> seqNo;
-      m_adjLsaSeq = (seqNo & 0xFFFFF);
-      m_corLsaSeq = ((seqNo >> 20) & 0xFFFFF);
-      m_nameLsaSeq = ((seqNo >> 40) & 0xFFFFFF);
-    }
+    inputFile >> seqType >> m_nameLsaSeq;
+    inputFile >> seqType >> m_adjLsaSeq;
+    inputFile >> seqType >> m_corLsaSeq;
 
     inputFile.close();
 
+    // Increment by 10 in case last run of NLSR was not able to write to file
+    // before crashing
     m_nameLsaSeq += 10;
 
     // Increment the adjacency LSA seq. no. if link-state or dry HR is enabled
     if (m_hyperbolicState != HYPERBOLIC_STATE_ON) {
       if (m_corLsaSeq != 0) {
-        NLSR_LOG_WARN("This router was previously configured for hyperbolic"
-                   << " routing without clearing the seq. no. file.");
+        NLSR_LOG_WARN("This router was previously configured for hyperbolic " <<
+                      "routing without clearing the seq. no. file.");
         m_corLsaSeq = 0;
       }
       m_adjLsaSeq += 10;
@@ -109,8 +86,8 @@
     // Similarly, increment the coordinate LSA seq. no only if link-state is disabled.
     if (m_hyperbolicState != HYPERBOLIC_STATE_OFF) {
       if (m_adjLsaSeq != 0) {
-        NLSR_LOG_WARN("This router was previously configured for link-state"
-                  << " routing without clearing the seq. no. file.");
+        NLSR_LOG_WARN("This router was previously configured for link-state " <<
+                      "routing without clearing the seq. no. file.");
         m_adjLsaSeq = 0;
       }
       m_corLsaSeq += 10;
@@ -137,7 +114,6 @@
 void
 SequencingManager::writeLog() const
 {
-  NLSR_LOG_DEBUG("----SequencingManager----");
   if (m_hyperbolicState == HYPERBOLIC_STATE_OFF ||
       m_hyperbolicState == HYPERBOLIC_STATE_DRY_RUN) {
     NLSR_LOG_DEBUG("Adj LSA seq no: " << m_adjLsaSeq);
diff --git a/src/sequencing-manager.hpp b/src/sequencing-manager.hpp
index 85e323b..307aab5 100644
--- a/src/sequencing-manager.hpp
+++ b/src/sequencing-manager.hpp
@@ -36,7 +36,7 @@
 class SequencingManager
 {
 public:
-  SequencingManager(std::string filePath, int hypState);
+  SequencingManager(const std::string& filePath, int hypState);
 
   uint64_t
   getNameLsaSeq() const
@@ -113,9 +113,9 @@
   writeLog() const;
 
 private:
-  uint64_t m_nameLsaSeq;
-  uint64_t m_adjLsaSeq;
-  uint64_t m_corLsaSeq;
+  uint64_t m_nameLsaSeq = 0;
+  uint64_t m_adjLsaSeq = 0;
+  uint64_t m_corLsaSeq = 0;
   std::string m_seqFileNameWithPath;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
diff --git a/tests/test-sequencing-manager.cpp b/tests/test-sequencing-manager.cpp
index d1c928b..6bbcb00 100644
--- a/tests/test-sequencing-manager.cpp
+++ b/tests/test-sequencing-manager.cpp
@@ -46,23 +46,24 @@
   }
 
   void
-  writeToFile(const std::string& testSeq) {
+  writeToFile(const std::string& testSeq)
+  {
     std::ofstream outputFile(seqFile, std::ofstream::trunc);
     outputFile << testSeq;
     outputFile.close();
   }
 
   void
-  initiateFromFile() {
+  initiateFromFile()
+  {
     m_seqManager.initiateSeqNoFromFile();
   }
 
   void
-  checkSeqNumbers(const uint64_t& name, const uint64_t& adj, const uint64_t& cor) {
+  checkSeqNumbers(const uint64_t& name, const uint64_t& adj, const uint64_t& cor)
+  {
     BOOST_CHECK_EQUAL(m_seqManager.getNameLsaSeq(), name);
-
     BOOST_CHECK_EQUAL(m_seqManager.getAdjLsaSeq(), adj);
-
     BOOST_CHECK_EQUAL(m_seqManager.getCorLsaSeq(), cor);
   }
 
@@ -73,36 +74,30 @@
 
 BOOST_FIXTURE_TEST_SUITE(TestSequencingManager, SequencingManagerFixture)
 
-BOOST_AUTO_TEST_CASE(CombinedSeqNumber)
-{
-  // LS
-  writeToFile("27121653322350672");
-  m_seqManager.m_hyperbolicState = HYPERBOLIC_STATE_OFF;
-  initiateFromFile();
-  checkSeqNumbers(24667+10, 80+10, 0);
-
-  // HR
-  writeToFile("27121653322350672");
-  m_seqManager.m_hyperbolicState = HYPERBOLIC_STATE_ON;
-  initiateFromFile();
-  // AdjLsa is set to 0 since HR is on
-  checkSeqNumbers(24667+10, 0, 0+10);
-}
-
 BOOST_AUTO_TEST_CASE(SeparateSeqNumber)
 {
+  initiateFromFile();
+  checkSeqNumbers(0, 0, 0);
+
   // LS
   writeToFile("NameLsaSeq 100\nAdjLsaSeq 100\nCorLsaSeq 0");
   m_seqManager.m_hyperbolicState = HYPERBOLIC_STATE_OFF;
   initiateFromFile();
-  checkSeqNumbers(100+10, 100+10, 0);
+  checkSeqNumbers(100 + 10, 100 + 10, 0);
 
   // HR
   writeToFile("NameLsa 100\nAdjLsa 0\nCorLsa 100");
   m_seqManager.m_hyperbolicState = HYPERBOLIC_STATE_ON;
   initiateFromFile();
   // AdjLsa is set to 0 since HR is on
-  checkSeqNumbers(100+10, 0, 100+10);
+  checkSeqNumbers(100 + 10, 0, 100 + 10);
+}
+
+BOOST_AUTO_TEST_CASE(CorruptFile)
+{
+  writeToFile("NameLsaSeq");
+  initiateFromFile();
+  checkSeqNumbers(10, 10, 0);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
