diff --git a/src/nlsr_lsa.hpp b/src/nlsr_lsa.hpp
index 06dcbc6..878d688 100644
--- a/src/nlsr_lsa.hpp
+++ b/src/nlsr_lsa.hpp
@@ -16,71 +16,70 @@
   {
   public:
     Lsa()
-      : origRouter()
-      , lsSeqNo()
-      , lifeTime()
-      , lsaExpiringEventId()
+      : m_origRouter()
+      , m_lsSeqNo()
+      , m_lifeTime()
+      , m_expiringEventId()
     {
     }
 
 
     void setLsType(uint8_t lst)
     {
-      lsType=lst;
+      m_lsType=lst;
     }
 
     uint8_t getLsType()
     {
-      return lsType;
+      return m_lsType;
     }
 
     void setLsSeqNo(uint32_t lsn)
     {
-      lsSeqNo=lsn;
+      m_lsSeqNo=lsn;
     }
 
     uint32_t getLsSeqNo()
     {
-      return lsSeqNo;
+      return m_lsSeqNo;
     }
 
     string& getOrigRouter()
     {
-      return origRouter;
+      return m_origRouter;
     }
 
     void setOrigRouter(string& org)
     {
-      origRouter=org;
+      m_origRouter=org;
     }
 
     uint32_t getLifeTime()
     {
-      return lifeTime;
+      return m_lifeTime;
     }
 
     void setLifeTime(uint32_t lt)
     {
-      lifeTime=lt;
+      m_lifeTime=lt;
     }
 
-    void setLsaExpiringEventId(ndn::EventId leei)
+    void setExpiringEventId(ndn::EventId leei)
     {
-      lsaExpiringEventId=leei;
+      m_expiringEventId=leei;
     }
 
-    ndn::EventId getLsaExpiringEventId()
+    ndn::EventId getExpiringEventId()
     {
-      return lsaExpiringEventId;
+      return m_expiringEventId;
     }
 
-
   protected:
-    string origRouter;
-    uint8_t lsType;
-    uint32_t lsSeqNo;
-    uint32_t lifeTime;
-    ndn::EventId lsaExpiringEventId;
+    string m_origRouter;
+    uint8_t m_lsType;
+    uint32_t m_lsSeqNo;
+    uint32_t m_lifeTime;
+    ndn::EventId m_expiringEventId;
   };
 
   class NameLsa:public Lsa
@@ -88,7 +87,7 @@
   public:
     NameLsa()
       : Lsa()
-      , npl()
+      , m_npl()
     {
       setLsType(1);
     }
@@ -97,26 +96,27 @@
 
     Npl& getNpl()
     {
-      return npl;
+      return m_npl;
     }
 
-    void addNameToLsa(string& name)
+    void addName(string& name)
     {
-      npl.insertIntoNpl(name);
+      m_npl.insert(name);
     }
 
-    void removeNameFromLsa(string& name)
+    void removeName(string& name)
     {
-      npl.removeFromNpl(name);
+      m_npl.remove(name);
     }
 
-    string getNameLsaKey();
+    string getKey();
 
-    string getNameLsaData();
-    bool initNameLsaFromContent(string content);
+    string getData();
+    bool initializeFromContent(string content);
+    void writeLog();
 
   private:
-    Npl npl;
+    Npl m_npl;
 
   };
 
@@ -128,7 +128,7 @@
   public:
     AdjLsa()
       : Lsa()
-      , adl()
+      , m_adl()
     {
       setLsType(2);
     }
@@ -137,28 +137,28 @@
            uint32_t nl ,Adl padl);
     Adl& getAdl()
     {
-      return adl;
+      return m_adl;
     }
 
-    void addAdjacentToLsa(Adjacent adj)
+    void addAdjacent(Adjacent adj)
     {
-      adl.insert(adj);
+      m_adl.insert(adj);
     }
-    string getAdjLsaKey();
-    string getAdjLsaData();
-    bool initAdjLsaFromContent(string content);
+    string getKey();
+    string getData();
+    bool initializeFromContent(string content);
     uint32_t getNoLink()
     {
-      return noLink;
+      return m_noLink;
     }
 
-    bool isLsaContentEqual(AdjLsa& alsa);
-    void addNptEntriesForAdjLsa(Nlsr& pnlsr);
-    void removeNptEntriesForAdjLsa(Nlsr& pnlsr);
+    bool isEqual(AdjLsa& alsa);
+    void addNptEntries(Nlsr& pnlsr);
+    void removeNptEntries(Nlsr& pnlsr);
 
   private:
-    uint32_t noLink;
-    Adl adl;
+    uint32_t m_noLink;
+    Adl m_adl;
   };
 
   std::ostream&
@@ -169,22 +169,22 @@
   public:
     CorLsa()
       : Lsa()
-      , corRad(0)
-      , corTheta(0)
+      , m_corRad(0)
+      , m_corTheta(0)
     {
       setLsType(3);
     }
 
     CorLsa(string origR, uint8_t lst, uint32_t lsn, uint32_t lt
            , double r, double theta);
-    string getCorLsaKey();
-    string getCorLsaData();
-    bool initCorLsaFromContent(string content);
+    string getKey();
+    string getData();
+    bool initializeFromContent(string content);
     double getCorRadius()
     {
-      if ( corRad >= 0 )
+      if ( m_corRad >= 0 )
       {
-        return corRad;
+        return m_corRad;
       }
       else
       {
@@ -194,23 +194,23 @@
 
     void setCorRadius(double cr)
     {
-      corRad=cr;
+      m_corRad=cr;
     }
 
     double getCorTheta()
     {
-      return corTheta;
+      return m_corTheta;
     }
 
     void setCorTheta(double ct)
     {
-      corTheta=ct;
+      m_corTheta=ct;
     }
 
-    bool isLsaContentEqual(CorLsa& clsa);
+    bool isEqual(CorLsa& clsa);
   private:
-    double corRad;
-    double corTheta;
+    double m_corRad;
+    double m_corTheta;
 
   };
 
