diff --git a/src/utility/nlsr_logger.cpp b/src/utility/nlsr_logger.cpp
index 82b6e75..f214c6a 100644
--- a/src/utility/nlsr_logger.cpp
+++ b/src/utility/nlsr_logger.cpp
@@ -49,7 +49,7 @@
           keywords::min_free_space = 64 * 1024 * 1024
         ));
     sink->set_formatter(
-      expr::format("%1%: %2%")
+      expr::format("%1% %2%")
       % getEpochTime()
       % expr::smessage
     );
diff --git a/src/utility/nlsr_tokenizer.cpp b/src/utility/nlsr_tokenizer.cpp
index 35d6625..a1ed2bd 100644
--- a/src/utility/nlsr_tokenizer.cpp
+++ b/src/utility/nlsr_tokenizer.cpp
@@ -15,8 +15,8 @@
   void
   nlsrTokenizer::makeToken()
   {
-    char_separator<char> sep(seps.c_str());
-    tokenizer< char_separator<char> >tokens(originalString, sep);
+    char_separator<char> sep(m_seps.c_str());
+    tokenizer< char_separator<char> >tokens(m_originalString, sep);
     tokenizer< char_separator<char> >::iterator tok_iter = tokens.begin();
     for ( ; tok_iter != tokens.end(); ++tok_iter)
     {
@@ -27,15 +27,15 @@
         insertToken(oneToken);
       }
     }
-    firstToken=vTokenList[0];
+    m_firstToken=m_vTokenList[0];
     makeRestOfTheLine();
   }
 
   void
   nlsrTokenizer::insertToken(const string& token)
   {
-    tokenList.push_back(token);
-    vTokenList.push_back(token);
+    m_tokenList.push_back(token);
+    m_vTokenList.push_back(token);
   }
 
   int
@@ -43,8 +43,8 @@
   {
     int pos=-1;
     int i=0;
-    for(std::list<string>::iterator it=tokenList.begin();
-        it!=tokenList.end(); it++)
+    for(std::list<string>::iterator it=m_tokenList.begin();
+        it!=m_tokenList.end(); it++)
     {
       if( (*it) == token )
       {
@@ -52,7 +52,7 @@
       }
       i++;
     }
-    if( i < tokenList.size() )
+    if( i < m_tokenList.size() )
     {
       pos=i;
     }
@@ -63,13 +63,13 @@
   nlsrTokenizer::getTokenString(int from , int to)
   {
     string returnString="";
-    if((from>=0 && to<tokenList.size()) &&
-        (to>=from && to <tokenList.size()))
+    if((from>=0 && to<m_tokenList.size()) &&
+        (to>=from && to <m_tokenList.size()))
     {
       for(int i=from; i<=to; i++)
       {
-        returnString+=seps;
-        returnString+=vTokenList[i];
+        returnString+=m_seps;
+        returnString+=m_vTokenList[i];
       }
     }
     trim(returnString);
@@ -79,7 +79,7 @@
   string
   nlsrTokenizer::getTokenString(int from)
   {
-    return getTokenString(from,tokenList.size()-1);
+    return getTokenString(from,m_tokenList.size()-1);
   }
 
   static bool
@@ -91,16 +91,16 @@
   void
   nlsrTokenizer::makeRestOfTheLine()
   {
-    restOfTheLine=getTokenString(1);
+    m_restOfTheLine=getTokenString(1);
   }
 
   bool
   nlsrTokenizer::doesTokenExist(string token)
   {
-    std::list<string >::iterator it = std::find_if( tokenList.begin(),
-                                      tokenList.end(),
+    std::list<string >::iterator it = std::find_if( m_tokenList.begin(),
+                                      m_tokenList.end(),
                                       bind(&tokenCompare, _1 , token));
-    if( it != tokenList.end() )
+    if( it != m_tokenList.end() )
     {
       return true;
     }
diff --git a/src/utility/nlsr_tokenizer.hpp b/src/utility/nlsr_tokenizer.hpp
index 4b84d8b..02d6eea 100644
--- a/src/utility/nlsr_tokenizer.hpp
+++ b/src/utility/nlsr_tokenizer.hpp
@@ -19,62 +19,62 @@
   {
   public:
     nlsrTokenizer(const string& inputString)
-      : firstToken()
-      , restOfTheLine()
-      , currentPosition(0)
+      : m_firstToken()
+      , m_restOfTheLine()
+      , m_currentPosition(0)
     {
-      seps = " ";
-      originalString = inputString;
+      m_seps = " ";
+      m_originalString = inputString;
       makeToken();
     }
 
     nlsrTokenizer(const string& inputString, const string& separator)
-      : firstToken()
-      , restOfTheLine()
-      , currentPosition(0)
+      : m_firstToken()
+      , m_restOfTheLine()
+      , m_currentPosition(0)
     {
-      seps = separator;
-      originalString = inputString;
+      m_seps = separator;
+      m_originalString = inputString;
       makeToken();
     }
 
     string getFirstToken()
     {
-      return firstToken;
+      return m_firstToken;
     }
 
     string getRestOfLine()
     {
-      return restOfTheLine;
+      return m_restOfTheLine;
     }
 
     void resetCurrentPosition(uint32_t cp=0)
     {
-      if( cp >=0 && cp <= vTokenList.size() )
+      if( cp >=0 && cp <= m_vTokenList.size() )
       {
-        currentPosition=cp;
+        m_currentPosition=cp;
       }
     }
 
     string getNextToken()
     {
-      if(currentPosition >= 0 && currentPosition <= (vTokenList.size()-1))
+      if(m_currentPosition >= 0 && m_currentPosition <= (m_vTokenList.size()-1))
       {
-        return vTokenList[currentPosition++];
+        return m_vTokenList[m_currentPosition++];
       }
       return "";
     }
 
     uint32_t getTokenNumber()
     {
-      return tokenList.size();
+      return m_tokenList.size();
     }
 
     string getToken(int position)
     {
-      if( position >=0 && position <vTokenList.size() )
+      if( position >=0 && position <m_vTokenList.size() )
       {
-        return vTokenList[position];
+        return m_vTokenList[position];
       }
       return "";
     }
@@ -91,13 +91,13 @@
     void insertToken(const string& token);
     void makeRestOfTheLine();
 
-    string seps;
-    string originalString;
-    string firstToken;
-    string restOfTheLine;
-    std::list<string> tokenList;
-    std::vector<string> vTokenList;
-    uint32_t currentPosition;
+    string m_seps;
+    string m_originalString;
+    string m_firstToken;
+    string m_restOfTheLine;
+    std::list<string> m_tokenList;
+    std::vector<string> m_vTokenList;
+    uint32_t m_currentPosition;
   };
 
 }//namespace nlsr
