diff --git a/manager.cpp b/manager.cpp
index 286b81a..15ff083 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -25,55 +25,18 @@
 namespace blobs
 {
 
-void BlobManager::incrementOpen(const std::string& path)
-{
-    if (path.empty())
-    {
-        return;
-    }
-
-    openFiles[path] += 1;
-}
-
-void BlobManager::decrementOpen(const std::string& path)
-{
-    if (path.empty())
-    {
-        return;
-    }
-
-    /* TODO(venture): Check into the iterator from find, does it makes sense
-     * to just update it directly? */
-    auto entry = openFiles.find(path);
-    if (entry != openFiles.end())
-    {
-        /* found it, decrement it and remove it if 0. */
-        openFiles[path] -= 1;
-        if (openFiles[path] == 0)
-        {
-            openFiles.erase(path);
-        }
-    }
-}
-
-int BlobManager::getOpen(const std::string& path) const
-{
-    /* No need to input check on the read-only call. */
-    auto entry = openFiles.find(path);
-    if (entry != openFiles.end())
-    {
-        return entry->second;
-    }
-
-    return 0;
-}
-
 void BlobManager::eraseSession(GenericBlobInterface* handler, uint16_t session)
 {
     sessions.erase(session);
     /* Ok for openSessions[handler] to be an empty set */
     openSessions[handler].erase(session);
-    decrementOpen(getPath(session));
+
+    auto path = getPath(session);
+    openFiles[path]--;
+    if (openFiles[path] == 0)
+    {
+        openFiles.erase(path);
+    }
 }
 
 void BlobManager::cleanUpStaleSessions(GenericBlobInterface* handler)
@@ -189,7 +152,7 @@
     /* Associate session with handler */
     sessions[*session] = SessionInfo(path, handler, flags);
     openSessions[handler].insert(*session);
-    incrementOpen(path);
+    openFiles[path]++;
     return true;
 }
 
@@ -310,7 +273,7 @@
     }
 
     /* Check if the file has any open handles. */
-    if (getOpen(path) > 0)
+    if (openFiles[path] > 0)
     {
         return false;
     }
diff --git a/manager.hpp b/manager.hpp
index 011fe88..cba7935 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -276,10 +276,6 @@
     std::string getPath(uint16_t session) const;
 
   private:
-    void incrementOpen(const std::string& path);
-    void decrementOpen(const std::string& path);
-    int getOpen(const std::string& path) const;
-
     /* Helper method to erase a session from all maps */
     void eraseSession(GenericBlobInterface* handler, uint16_t session);
     /* For each session owned by this handler, call expire if it is stale */
