diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5ac62eb0b17bebb2c3092f79b269cea1021fb6d..aba514ef4e011bfb0261fde02850f32406d85c62 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,9 +29,7 @@ set(CMAKE_DISABLE_SOURCE_CHANGES ON)
 set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
 list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 
-include_directories(${CMAKE_SOURCE_DIR})
-
-add_subdirectory(libs)
+add_subdirectory(middletier)
 add_subdirectory(objectstore)
 add_subdirectory(objectstore_middletier)
 add_subdirectory(tests)
diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt
deleted file mode 100644
index df8559d2c942c1c60b8c4134e3f0596adadfa46d..0000000000000000000000000000000000000000
--- a/libs/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-
-add_subdirectory(middletier)
diff --git a/libs/middletier/CMakeLists.txt b/libs/middletier/CMakeLists.txt
deleted file mode 100644
index 8bafe4336b233c4bdcb2853bd928df0f3b85819b..0000000000000000000000000000000000000000
--- a/libs/middletier/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-
-find_package (sqlite REQUIRED)
-include_directories (${SQLITE3_INCLUDE_DIR} ${CMAKE_SOURCE_DIR})
-
-set (MIDDLE_TIER_LIB_SRC_FILES
-  AdminHost.cpp
-  AdminUser.cpp
-  ArchivalJob.cpp
-  ArchivalJobState.cpp
-  ArchiveRoute.cpp
-  ArchiveRouteId.cpp
-  DirectoryEntry.cpp
-  DirectoryIterator.cpp
-  Exception.cpp
-  FileAttribute.cpp
-  FileSystemDirectoryEntry.cpp
-  FileSystemNode.cpp
-  FileSystemStorageClass.cpp
-  FileSystemStorageClasses.cpp
-  LogicalLibrary.cpp
-  MiddleTierAdmin.cpp
-  MiddleTierUser.cpp
-  RetrievalJob.cpp
-  RetrievalJobState.cpp
-  SecurityIdentity.cpp
-  SqliteDatabase.cpp
-  SqliteMiddleTierAdmin.cpp
-  SqliteMiddleTierUser.cpp
-  StorageClass.cpp
-  Tape.cpp
-  TapePool.cpp
-  UserIdentity.cpp
-  Utils.cpp
-  Vfs.cpp)
-
-add_library (ctamiddletier SHARED
-  ${MIDDLE_TIER_LIB_SRC_FILES})
-
-target_link_libraries (ctamiddletier ${SQLITE3_LIBRARY_RELEASE})
-
-set (MIDDLE_TIER_UNIT_TESTS_LIB_SRC_FILES
-  SqliteMiddleTierAdminTest.cpp
-  SqliteMiddleTierUserTest.cpp
-  UtilsTest.cpp
-  VfsTest.cpp)
-
-add_library (ctamiddletierunittests SHARED
-  ${MIDDLE_TIER_UNIT_TESTS_LIB_SRC_FILES})
-
-target_link_libraries (ctamiddletierunittests ${SQLITE3_LIBRARY_RELEASE})
diff --git a/middletier/CMakeLists.txt b/middletier/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..cc8dc2a34267dcfa3744d2dac698cef6cf5b7fd1
--- /dev/null
+++ b/middletier/CMakeLists.txt
@@ -0,0 +1,51 @@
+cmake_minimum_required (VERSION 2.6)
+
+find_package (sqlite REQUIRED)
+include_directories (${SQLITE3_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+
+set (MIDDLE_TIER_LIB_SRC_FILES
+  cta/AdminHost.cpp
+  cta/AdminUser.cpp
+  cta/ArchivalJob.cpp
+  cta/ArchivalJobState.cpp
+  cta/ArchiveRoute.cpp
+  cta/ArchiveRouteId.cpp
+  cta/DirectoryEntry.cpp
+  cta/DirectoryIterator.cpp
+  cta/Exception.cpp
+  cta/FileAttribute.cpp
+  cta/FileSystemDirectoryEntry.cpp
+  cta/FileSystemNode.cpp
+  cta/FileSystemStorageClass.cpp
+  cta/FileSystemStorageClasses.cpp
+  cta/LogicalLibrary.cpp
+  cta/MiddleTierAdmin.cpp
+  cta/MiddleTierUser.cpp
+  cta/RetrievalJob.cpp
+  cta/RetrievalJobState.cpp
+  cta/SecurityIdentity.cpp
+  cta/SqliteDatabase.cpp
+  cta/SqliteMiddleTierAdmin.cpp
+  cta/SqliteMiddleTierUser.cpp
+  cta/StorageClass.cpp
+  cta/Tape.cpp
+  cta/TapePool.cpp
+  cta/UserIdentity.cpp
+  cta/Utils.cpp
+  cta/Vfs.cpp)
+
+add_library (ctamiddletier SHARED
+  ${MIDDLE_TIER_LIB_SRC_FILES})
+
+target_link_libraries (ctamiddletier ${SQLITE3_LIBRARY_RELEASE})
+
+set (MIDDLE_TIER_UNIT_TESTS_LIB_SRC_FILES
+  cta/SqliteMiddleTierAdminTest.cpp
+  cta/SqliteMiddleTierUserTest.cpp
+  cta/UtilsTest.cpp
+  cta/VfsTest.cpp)
+
+add_library (ctamiddletierunittests SHARED
+  ${MIDDLE_TIER_UNIT_TESTS_LIB_SRC_FILES})
+
+target_link_libraries (ctamiddletierunittests ${SQLITE3_LIBRARY_RELEASE})
diff --git a/libs/middletier/AdminHost.cpp b/middletier/cta/AdminHost.cpp
similarity index 98%
rename from libs/middletier/AdminHost.cpp
rename to middletier/cta/AdminHost.cpp
index 3041a3907602209aa74cde54f90f8c78705788b4..39735f75dfbfbe853e90b97c781468022b2c3320 100644
--- a/libs/middletier/AdminHost.cpp
+++ b/middletier/cta/AdminHost.cpp
@@ -1,4 +1,4 @@
-#include "AdminHost.hpp"
+#include "cta/AdminHost.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/AdminHost.hpp b/middletier/cta/AdminHost.hpp
similarity index 98%
rename from libs/middletier/AdminHost.hpp
rename to middletier/cta/AdminHost.hpp
index 33176bf9b22927b07f6df0f14250f85efe902702..a7ffdc6c94a28d9dcbb14f3cf8b31ad23126c21a 100644
--- a/libs/middletier/AdminHost.hpp
+++ b/middletier/cta/AdminHost.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 
diff --git a/libs/middletier/AdminUser.cpp b/middletier/cta/AdminUser.cpp
similarity index 98%
rename from libs/middletier/AdminUser.cpp
rename to middletier/cta/AdminUser.cpp
index 881de88ddececed2f7cf910f4a4dd16e9370df32..2a2240a63a2e01ad5eced00ac3be810cbbbb2fce 100644
--- a/libs/middletier/AdminUser.cpp
+++ b/middletier/cta/AdminUser.cpp
@@ -1,4 +1,4 @@
-#include "AdminUser.hpp"
+#include "cta/AdminUser.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/AdminUser.hpp b/middletier/cta/AdminUser.hpp
similarity index 98%
rename from libs/middletier/AdminUser.hpp
rename to middletier/cta/AdminUser.hpp
index 7a3827a589fda900b7f8313e722f37dcae4909dd..2a7dc0526c7a9370e6d6ff0f9ffe20290378ed6c 100644
--- a/libs/middletier/AdminUser.hpp
+++ b/middletier/cta/AdminUser.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 
diff --git a/libs/middletier/ArchivalJob.cpp b/middletier/cta/ArchivalJob.cpp
similarity index 98%
rename from libs/middletier/ArchivalJob.cpp
rename to middletier/cta/ArchivalJob.cpp
index e7aa755b0d1feddb59b1bd788da5e3f678cbd8dc..e8964aed07db7819d851fcc692327ab0312ecb55 100644
--- a/libs/middletier/ArchivalJob.cpp
+++ b/middletier/cta/ArchivalJob.cpp
@@ -1,4 +1,4 @@
-#include "ArchivalJob.hpp"
+#include "cta/ArchivalJob.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/ArchivalJob.hpp b/middletier/cta/ArchivalJob.hpp
similarity index 97%
rename from libs/middletier/ArchivalJob.hpp
rename to middletier/cta/ArchivalJob.hpp
index 95726bf92ae1e02a79f0f1a614cceacb5b08a429..f0b278ea636947e97310f8f577b55d30f47d65b3 100644
--- a/libs/middletier/ArchivalJob.hpp
+++ b/middletier/cta/ArchivalJob.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "ArchivalJobState.hpp"
-#include "UserIdentity.hpp"
+#include "cta/ArchivalJobState.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 #include <time.h>
diff --git a/libs/middletier/ArchivalJobState.cpp b/middletier/cta/ArchivalJobState.cpp
similarity index 93%
rename from libs/middletier/ArchivalJobState.cpp
rename to middletier/cta/ArchivalJobState.cpp
index 77738f3ab9a70b91640cd64393b8be7717b53784..f6b231d639037477ac70bf54926e52a9314337eb 100644
--- a/libs/middletier/ArchivalJobState.cpp
+++ b/middletier/cta/ArchivalJobState.cpp
@@ -1,4 +1,4 @@
-#include "ArchivalJob.hpp"
+#include "cta/ArchivalJob.hpp"
 
 //------------------------------------------------------------------------------
 // toStr
diff --git a/libs/middletier/ArchivalJobState.hpp b/middletier/cta/ArchivalJobState.hpp
similarity index 100%
rename from libs/middletier/ArchivalJobState.hpp
rename to middletier/cta/ArchivalJobState.hpp
diff --git a/libs/middletier/ArchiveRoute.cpp b/middletier/cta/ArchiveRoute.cpp
similarity index 98%
rename from libs/middletier/ArchiveRoute.cpp
rename to middletier/cta/ArchiveRoute.cpp
index 108811f447b469cc70d1dd85b0f1dbfa637ad6fb..8f383d664d4dee6fb363141385f70676cd60473b 100644
--- a/libs/middletier/ArchiveRoute.cpp
+++ b/middletier/cta/ArchiveRoute.cpp
@@ -1,4 +1,4 @@
-#include "ArchiveRoute.hpp"
+#include "cta/ArchiveRoute.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/ArchiveRoute.hpp b/middletier/cta/ArchiveRoute.hpp
similarity index 98%
rename from libs/middletier/ArchiveRoute.hpp
rename to middletier/cta/ArchiveRoute.hpp
index 09258f902331731e5ec28eee86c2256fb1e73517..82409845a36a8a7a48a1fde9d08ca96c7b9d8878 100644
--- a/libs/middletier/ArchiveRoute.hpp
+++ b/middletier/cta/ArchiveRoute.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <stdint.h>
 #include <string>
diff --git a/libs/middletier/ArchiveRouteId.cpp b/middletier/cta/ArchiveRouteId.cpp
similarity index 97%
rename from libs/middletier/ArchiveRouteId.cpp
rename to middletier/cta/ArchiveRouteId.cpp
index 0741b9427fbbc271bb3b3a9cb54c35abe924f083..92494fa550bf5fe97d7544afd2fba38262f1d310 100644
--- a/libs/middletier/ArchiveRouteId.cpp
+++ b/middletier/cta/ArchiveRouteId.cpp
@@ -1,4 +1,4 @@
-#include "ArchiveRouteId.hpp"
+#include "cta/ArchiveRouteId.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/ArchiveRouteId.hpp b/middletier/cta/ArchiveRouteId.hpp
similarity index 100%
rename from libs/middletier/ArchiveRouteId.hpp
rename to middletier/cta/ArchiveRouteId.hpp
diff --git a/libs/middletier/DirectoryEntry.cpp b/middletier/cta/DirectoryEntry.cpp
similarity index 98%
rename from libs/middletier/DirectoryEntry.cpp
rename to middletier/cta/DirectoryEntry.cpp
index bc9ac0d6127181fec2e23046b1532435f0778ea3..ee04a87ce1b0f13823e17442eaccc413e20eaeeb 100644
--- a/libs/middletier/DirectoryEntry.cpp
+++ b/middletier/cta/DirectoryEntry.cpp
@@ -1,4 +1,4 @@
-#include "DirectoryEntry.hpp"
+#include "cta/DirectoryEntry.hpp"
 
 //------------------------------------------------------------------------------
 // entryTypeToStr
diff --git a/libs/middletier/DirectoryEntry.hpp b/middletier/cta/DirectoryEntry.hpp
similarity index 100%
rename from libs/middletier/DirectoryEntry.hpp
rename to middletier/cta/DirectoryEntry.hpp
diff --git a/libs/middletier/DirectoryIterator.cpp b/middletier/cta/DirectoryIterator.cpp
similarity index 95%
rename from libs/middletier/DirectoryIterator.cpp
rename to middletier/cta/DirectoryIterator.cpp
index dbff1d5e3112f5fb722cba28bf9ff03114a5bdd1..68a95381c21b964921f7898753b63a77e3ebe4d0 100644
--- a/libs/middletier/DirectoryIterator.cpp
+++ b/middletier/cta/DirectoryIterator.cpp
@@ -1,5 +1,5 @@
-#include "DirectoryIterator.hpp"
-#include "Exception.hpp"
+#include "cta/DirectoryIterator.hpp"
+#include "cta/Exception.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/DirectoryIterator.hpp b/middletier/cta/DirectoryIterator.hpp
similarity index 97%
rename from libs/middletier/DirectoryIterator.hpp
rename to middletier/cta/DirectoryIterator.hpp
index 232efa492abcfa41700c920dacd7c8cdcf225442..a4289324d86ce1ede5a890ff62fb577c3c9548ac 100644
--- a/libs/middletier/DirectoryIterator.hpp
+++ b/middletier/cta/DirectoryIterator.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "DirectoryEntry.hpp"
+#include "cta/DirectoryEntry.hpp"
 
 #include <list>
 
diff --git a/libs/middletier/Exception.cpp b/middletier/cta/Exception.cpp
similarity index 96%
rename from libs/middletier/Exception.cpp
rename to middletier/cta/Exception.cpp
index 6754898b37b9d048807635fc4c5a7317535a2296..6cc84f390f04a6d4c8cd52c90f42b755b1dadf02 100644
--- a/libs/middletier/Exception.cpp
+++ b/middletier/cta/Exception.cpp
@@ -1,4 +1,4 @@
-#include "Exception.hpp"
+#include "cta/Exception.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/Exception.hpp b/middletier/cta/Exception.hpp
similarity index 100%
rename from libs/middletier/Exception.hpp
rename to middletier/cta/Exception.hpp
diff --git a/libs/middletier/FileAttribute.cpp b/middletier/cta/FileAttribute.cpp
similarity index 93%
rename from libs/middletier/FileAttribute.cpp
rename to middletier/cta/FileAttribute.cpp
index 84432ac75c2197652070f75c8e54c1c83308f7a7..2da24957aef6b5a9d0f5b3f57032870f0bd38b29 100644
--- a/libs/middletier/FileAttribute.cpp
+++ b/middletier/cta/FileAttribute.cpp
@@ -1,4 +1,4 @@
-#include "FileAttribute.hpp"
+#include "cta/FileAttribute.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/FileAttribute.hpp b/middletier/cta/FileAttribute.hpp
similarity index 100%
rename from libs/middletier/FileAttribute.hpp
rename to middletier/cta/FileAttribute.hpp
diff --git a/libs/middletier/FileSystemDirectoryEntry.cpp b/middletier/cta/FileSystemDirectoryEntry.cpp
similarity index 97%
rename from libs/middletier/FileSystemDirectoryEntry.cpp
rename to middletier/cta/FileSystemDirectoryEntry.cpp
index ecb7b95c537d09b3887c890420e0629bebfbe26f..7d37f6bc23974fd3d10e4be21ece8c85f994e488 100644
--- a/libs/middletier/FileSystemDirectoryEntry.cpp
+++ b/middletier/cta/FileSystemDirectoryEntry.cpp
@@ -1,4 +1,4 @@
-#include "FileSystemDirectoryEntry.hpp"
+#include "cta/FileSystemDirectoryEntry.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/FileSystemDirectoryEntry.hpp b/middletier/cta/FileSystemDirectoryEntry.hpp
similarity index 93%
rename from libs/middletier/FileSystemDirectoryEntry.hpp
rename to middletier/cta/FileSystemDirectoryEntry.hpp
index 01b204a0d203bd138d13ef3ddd43eccaa9f236a1..250fab3d0deae3994bd31cce29b37cf33fa7361c 100644
--- a/libs/middletier/FileSystemDirectoryEntry.hpp
+++ b/middletier/cta/FileSystemDirectoryEntry.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "DirectoryEntry.hpp"
-#include "FileSystemStorageClasses.hpp"
+#include "cta/DirectoryEntry.hpp"
+#include "cta/FileSystemStorageClasses.hpp"
 
 namespace cta {
 
diff --git a/libs/middletier/FileSystemNode.cpp b/middletier/cta/FileSystemNode.cpp
similarity index 98%
rename from libs/middletier/FileSystemNode.cpp
rename to middletier/cta/FileSystemNode.cpp
index e062fd82ff672df579b24c4dd054528bcfba6681..e2588ae78bb0cbc6a9e9a2700d979b1e31b5e3e8 100644
--- a/libs/middletier/FileSystemNode.cpp
+++ b/middletier/cta/FileSystemNode.cpp
@@ -1,5 +1,5 @@
-#include "Exception.hpp"
-#include "FileSystemNode.hpp"
+#include "cta/Exception.hpp"
+#include "cta/FileSystemNode.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/FileSystemNode.hpp b/middletier/cta/FileSystemNode.hpp
similarity index 97%
rename from libs/middletier/FileSystemNode.hpp
rename to middletier/cta/FileSystemNode.hpp
index bd88c0ab86b5d7fa06ebf7a128acecd4a4a8b08f..3a9517ae3704b48aeee65575378bf720f642fbfa 100644
--- a/libs/middletier/FileSystemNode.hpp
+++ b/middletier/cta/FileSystemNode.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "FileSystemDirectoryEntry.hpp"
-#include "FileSystemStorageClasses.hpp"
+#include "cta/FileSystemDirectoryEntry.hpp"
+#include "cta/FileSystemStorageClasses.hpp"
 
 #include <map>
 
diff --git a/libs/middletier/FileSystemStorageClass.cpp b/middletier/cta/FileSystemStorageClass.cpp
similarity index 98%
rename from libs/middletier/FileSystemStorageClass.cpp
rename to middletier/cta/FileSystemStorageClass.cpp
index 3269d6d7e639edc66fa1c92e1e71d1a10dbb924d..7450a795c23b39cd42e15638bb0409ee1139cff1 100644
--- a/libs/middletier/FileSystemStorageClass.cpp
+++ b/middletier/cta/FileSystemStorageClass.cpp
@@ -1,6 +1,6 @@
 #define __STDC_LIMIT_MACROS
 
-#include "FileSystemStorageClass.hpp"
+#include "cta/FileSystemStorageClass.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/FileSystemStorageClass.hpp b/middletier/cta/FileSystemStorageClass.hpp
similarity index 92%
rename from libs/middletier/FileSystemStorageClass.hpp
rename to middletier/cta/FileSystemStorageClass.hpp
index 70ac161d05a363cc1cea732cd8f44bdf5dc2703d..0becc5ee18bf8eac90c937749227a0ab4fd34d04 100644
--- a/libs/middletier/FileSystemStorageClass.hpp
+++ b/middletier/cta/FileSystemStorageClass.hpp
@@ -1,8 +1,8 @@
 #pragma once
 
-#include "Exception.hpp"
-#include "StorageClass.hpp"
-#include "UserIdentity.hpp"
+#include "cta/Exception.hpp"
+#include "cta/StorageClass.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <sstream>
 #include <string>
diff --git a/libs/middletier/FileSystemStorageClasses.cpp b/middletier/cta/FileSystemStorageClasses.cpp
similarity index 98%
rename from libs/middletier/FileSystemStorageClasses.cpp
rename to middletier/cta/FileSystemStorageClasses.cpp
index 52641487e7afe4f00233f690141430884b5cdc05..1d45a8933c29086239b053a7734655df9d774338 100644
--- a/libs/middletier/FileSystemStorageClasses.cpp
+++ b/middletier/cta/FileSystemStorageClasses.cpp
@@ -1,5 +1,5 @@
-#include "Exception.hpp"
-#include "FileSystemStorageClasses.hpp"
+#include "cta/Exception.hpp"
+#include "cta/FileSystemStorageClasses.hpp"
 
 #include <sstream>
 
diff --git a/libs/middletier/FileSystemStorageClasses.hpp b/middletier/cta/FileSystemStorageClasses.hpp
similarity index 97%
rename from libs/middletier/FileSystemStorageClasses.hpp
rename to middletier/cta/FileSystemStorageClasses.hpp
index c13a1eccb578e6829b13bb35d0b0e0f66acc327f..00c4037798d42d77ce6477b54af19f12ed8ff3f9 100644
--- a/libs/middletier/FileSystemStorageClasses.hpp
+++ b/middletier/cta/FileSystemStorageClasses.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "FileSystemStorageClass.hpp"
-#include "UserIdentity.hpp"
+#include "cta/FileSystemStorageClass.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <list>
 #include <map>
diff --git a/libs/middletier/LogicalLibrary.cpp b/middletier/cta/LogicalLibrary.cpp
similarity index 98%
rename from libs/middletier/LogicalLibrary.cpp
rename to middletier/cta/LogicalLibrary.cpp
index 003c8f4a9855b3fe3b28e4ba085d4be0f78d08a4..e08d844f0bb99398f293b5b8c3e1c63c066eef6a 100644
--- a/libs/middletier/LogicalLibrary.cpp
+++ b/middletier/cta/LogicalLibrary.cpp
@@ -1,4 +1,4 @@
-#include "LogicalLibrary.hpp"
+#include "cta/LogicalLibrary.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/LogicalLibrary.hpp b/middletier/cta/LogicalLibrary.hpp
similarity index 98%
rename from libs/middletier/LogicalLibrary.hpp
rename to middletier/cta/LogicalLibrary.hpp
index 7590a7a756bc59f36292825c2681626fa37e8177..4783286f71880ee25c5b8cd7f684823c836a43af 100644
--- a/libs/middletier/LogicalLibrary.hpp
+++ b/middletier/cta/LogicalLibrary.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 
diff --git a/libs/middletier/MiddleTierAdmin.cpp b/middletier/cta/MiddleTierAdmin.cpp
similarity index 86%
rename from libs/middletier/MiddleTierAdmin.cpp
rename to middletier/cta/MiddleTierAdmin.cpp
index 2d62bf66bfbe73cf76510cadf60888406fcaa235..f8166b352fcfaa98f6b88aa28e5d6426574daf07 100644
--- a/libs/middletier/MiddleTierAdmin.cpp
+++ b/middletier/cta/MiddleTierAdmin.cpp
@@ -1,4 +1,4 @@
-#include "MiddleTierAdmin.hpp"
+#include "cta/MiddleTierAdmin.hpp"
 
 //------------------------------------------------------------------------------
 // destructor
diff --git a/libs/middletier/MiddleTierAdmin.hpp b/middletier/cta/MiddleTierAdmin.hpp
similarity index 96%
rename from libs/middletier/MiddleTierAdmin.hpp
rename to middletier/cta/MiddleTierAdmin.hpp
index 7dd7184e1f30f47b9255e8a63a140ea70186fa9b..e52571a78dde9554930b8c5a50b5daf16cd5d35d 100644
--- a/libs/middletier/MiddleTierAdmin.hpp
+++ b/middletier/cta/MiddleTierAdmin.hpp
@@ -1,16 +1,16 @@
 #pragma once
 
-#include "AdminHost.hpp"
-#include "AdminUser.hpp"
-#include "ArchivalJob.hpp"
-#include "ArchiveRoute.hpp"
-#include "DirectoryIterator.hpp"
-#include "LogicalLibrary.hpp"
-#include "SecurityIdentity.hpp"
-#include "StorageClass.hpp"
-#include "Tape.hpp"
-#include "TapePool.hpp"
-#include "UserIdentity.hpp"
+#include "cta/AdminHost.hpp"
+#include "cta/AdminUser.hpp"
+#include "cta/ArchivalJob.hpp"
+#include "cta/ArchiveRoute.hpp"
+#include "cta/DirectoryIterator.hpp"
+#include "cta/LogicalLibrary.hpp"
+#include "cta/SecurityIdentity.hpp"
+#include "cta/StorageClass.hpp"
+#include "cta/Tape.hpp"
+#include "cta/TapePool.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <list>
 #include <stdint.h>
diff --git a/libs/middletier/MiddleTierUser.cpp b/middletier/cta/MiddleTierUser.cpp
similarity index 87%
rename from libs/middletier/MiddleTierUser.cpp
rename to middletier/cta/MiddleTierUser.cpp
index cb1d1472c4061fa2f33353a8f5a515b9bdad98a5..7be52d8fde3fc8b9475b6e2bfa92db6eea7e7adb 100644
--- a/libs/middletier/MiddleTierUser.cpp
+++ b/middletier/cta/MiddleTierUser.cpp
@@ -1,4 +1,4 @@
-#include "MiddleTierUser.hpp"
+#include "cta/MiddleTierUser.hpp"
 
 //------------------------------------------------------------------------------
 // destructor
diff --git a/libs/middletier/MiddleTierUser.hpp b/middletier/cta/MiddleTierUser.hpp
similarity index 95%
rename from libs/middletier/MiddleTierUser.hpp
rename to middletier/cta/MiddleTierUser.hpp
index bcc514b75b1a7cfc79e82975a2a6d7c4041c146c..0992f43d331cb05ee022675b66b3634a9c462185 100644
--- a/libs/middletier/MiddleTierUser.hpp
+++ b/middletier/cta/MiddleTierUser.hpp
@@ -1,15 +1,15 @@
 #pragma once
 
-#include "ArchivalJob.hpp"
-#include "ArchiveRoute.hpp"
-#include "DirectoryIterator.hpp"
-#include "LogicalLibrary.hpp"
-#include "RetrievalJob.hpp"
-#include "SecurityIdentity.hpp"
-#include "StorageClass.hpp"
-#include "Tape.hpp"
-#include "TapePool.hpp"
-#include "UserIdentity.hpp"
+#include "cta/ArchivalJob.hpp"
+#include "cta/ArchiveRoute.hpp"
+#include "cta/DirectoryIterator.hpp"
+#include "cta/LogicalLibrary.hpp"
+#include "cta/RetrievalJob.hpp"
+#include "cta/SecurityIdentity.hpp"
+#include "cta/StorageClass.hpp"
+#include "cta/Tape.hpp"
+#include "cta/TapePool.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <list>
 #include <map>
diff --git a/libs/middletier/RetrievalJob.cpp b/middletier/cta/RetrievalJob.cpp
similarity index 98%
rename from libs/middletier/RetrievalJob.cpp
rename to middletier/cta/RetrievalJob.cpp
index f1336cd2348c2c2b05cfbe7d4846de3ccf7412d3..bb9dac4afa292f5122221bf2059b772e791c64a3 100644
--- a/libs/middletier/RetrievalJob.cpp
+++ b/middletier/cta/RetrievalJob.cpp
@@ -1,4 +1,4 @@
-#include "RetrievalJob.hpp"
+#include "cta/RetrievalJob.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/RetrievalJob.hpp b/middletier/cta/RetrievalJob.hpp
similarity index 97%
rename from libs/middletier/RetrievalJob.hpp
rename to middletier/cta/RetrievalJob.hpp
index 5f11eaf8e3f1592d35651075445c01f50b9f5172..d2b424e20929b37d5f8d9cf7e65c17a0e31d4f3f 100644
--- a/libs/middletier/RetrievalJob.hpp
+++ b/middletier/cta/RetrievalJob.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "RetrievalJobState.hpp"
-#include "UserIdentity.hpp"
+#include "cta/RetrievalJobState.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 #include <time.h>
diff --git a/libs/middletier/RetrievalJobState.cpp b/middletier/cta/RetrievalJobState.cpp
similarity index 93%
rename from libs/middletier/RetrievalJobState.cpp
rename to middletier/cta/RetrievalJobState.cpp
index ee514a7c60c951a1cac21436cb811c39f4642971..014685999ef7e8126095bd7111c9c811f586e3fd 100644
--- a/libs/middletier/RetrievalJobState.cpp
+++ b/middletier/cta/RetrievalJobState.cpp
@@ -1,4 +1,4 @@
-#include "RetrievalJob.hpp"
+#include "cta/RetrievalJob.hpp"
 
 //------------------------------------------------------------------------------
 // toStr
diff --git a/libs/middletier/RetrievalJobState.hpp b/middletier/cta/RetrievalJobState.hpp
similarity index 100%
rename from libs/middletier/RetrievalJobState.hpp
rename to middletier/cta/RetrievalJobState.hpp
diff --git a/libs/middletier/SecurityIdentity.cpp b/middletier/cta/SecurityIdentity.cpp
similarity index 93%
rename from libs/middletier/SecurityIdentity.cpp
rename to middletier/cta/SecurityIdentity.cpp
index c15aeeb03d841800a9f679a161fa40ec259f6ea5..2027cbcd32f892d8ebb9cd0a4940cf86c414bf88 100644
--- a/libs/middletier/SecurityIdentity.cpp
+++ b/middletier/cta/SecurityIdentity.cpp
@@ -1,4 +1,4 @@
-#include "SecurityIdentity.hpp"
+#include "cta/SecurityIdentity.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/SecurityIdentity.hpp b/middletier/cta/SecurityIdentity.hpp
similarity index 94%
rename from libs/middletier/SecurityIdentity.hpp
rename to middletier/cta/SecurityIdentity.hpp
index 762f9ee59a70c02eeb880347319e3f7fab82f6a2..d2062c766971f30be287f9e599fe0c792879fcd9 100644
--- a/libs/middletier/SecurityIdentity.hpp
+++ b/middletier/cta/SecurityIdentity.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 
diff --git a/libs/middletier/SqliteDatabase.cpp b/middletier/cta/SqliteDatabase.cpp
similarity index 99%
rename from libs/middletier/SqliteDatabase.cpp
rename to middletier/cta/SqliteDatabase.cpp
index 728185ffbf398372335039de3ba4988256c8107b..c7d31fa867a9cc2a0f138df315ef1d4e20bee52f 100644
--- a/libs/middletier/SqliteDatabase.cpp
+++ b/middletier/cta/SqliteDatabase.cpp
@@ -1,6 +1,6 @@
-#include "Exception.hpp"
-#include "SqliteDatabase.hpp"
-#include "Utils.hpp"
+#include "cta/Exception.hpp"
+#include "cta/SqliteDatabase.hpp"
+#include "cta/Utils.hpp"
 
 #include <iostream>
 #include <memory>
diff --git a/libs/middletier/SqliteDatabase.hpp b/middletier/cta/SqliteDatabase.hpp
similarity index 93%
rename from libs/middletier/SqliteDatabase.hpp
rename to middletier/cta/SqliteDatabase.hpp
index 0bc9bc037c2d4c52a198c7d5b1c1a52016bc8ad4..0f85524b83e437c56fc02ea87c904a14546ff818 100644
--- a/libs/middletier/SqliteDatabase.hpp
+++ b/middletier/cta/SqliteDatabase.hpp
@@ -5,16 +5,16 @@
 
 #include <sqlite3.h>
 
-#include "AdminHost.hpp"
-#include "AdminUser.hpp"
-#include "ArchivalJob.hpp"
-#include "ArchiveRoute.hpp"
-#include "LogicalLibrary.hpp"
-#include "RetrievalJob.hpp"
-#include "SecurityIdentity.hpp"
-#include "StorageClass.hpp"
-#include "Tape.hpp"
-#include "TapePool.hpp"
+#include "cta/AdminHost.hpp"
+#include "cta/AdminUser.hpp"
+#include "cta/ArchivalJob.hpp"
+#include "cta/ArchiveRoute.hpp"
+#include "cta/LogicalLibrary.hpp"
+#include "cta/RetrievalJob.hpp"
+#include "cta/SecurityIdentity.hpp"
+#include "cta/StorageClass.hpp"
+#include "cta/Tape.hpp"
+#include "cta/TapePool.hpp"
 
 namespace cta {
 
diff --git a/libs/middletier/SqliteMiddleTierAdmin.cpp b/middletier/cta/SqliteMiddleTierAdmin.cpp
similarity index 99%
rename from libs/middletier/SqliteMiddleTierAdmin.cpp
rename to middletier/cta/SqliteMiddleTierAdmin.cpp
index 6077ab2135f8fa69240683c43f0ae7360f8620e9..e85a9896ae8ab340cdd8b73ef7022d371233436c 100644
--- a/libs/middletier/SqliteMiddleTierAdmin.cpp
+++ b/middletier/cta/SqliteMiddleTierAdmin.cpp
@@ -1,5 +1,5 @@
-#include "Exception.hpp"
-#include "SqliteMiddleTierAdmin.hpp"
+#include "cta/Exception.hpp"
+#include "cta/SqliteMiddleTierAdmin.hpp"
 
 #include <iostream>
 #include <memory>
diff --git a/libs/middletier/SqliteMiddleTierAdmin.hpp b/middletier/cta/SqliteMiddleTierAdmin.hpp
similarity index 98%
rename from libs/middletier/SqliteMiddleTierAdmin.hpp
rename to middletier/cta/SqliteMiddleTierAdmin.hpp
index bff3f2fb0a3d04e4cb0bd5af19370059b333303f..7931d4ba7ed22f0d942c87bca6c1ce2a95e99a1a 100644
--- a/libs/middletier/SqliteMiddleTierAdmin.hpp
+++ b/middletier/cta/SqliteMiddleTierAdmin.hpp
@@ -1,8 +1,8 @@
 #pragma once
 
-#include "MiddleTierAdmin.hpp"
-#include "SqliteDatabase.hpp"
-#include "Vfs.hpp"
+#include "cta/MiddleTierAdmin.hpp"
+#include "cta/SqliteDatabase.hpp"
+#include "cta/Vfs.hpp"
 
 namespace cta {
 
diff --git a/libs/middletier/SqliteMiddleTierAdminTest.cpp b/middletier/cta/SqliteMiddleTierAdminTest.cpp
similarity index 99%
rename from libs/middletier/SqliteMiddleTierAdminTest.cpp
rename to middletier/cta/SqliteMiddleTierAdminTest.cpp
index a2fc3bf1de03aae77de9a48604514ad2dfc0f3ca..9fc74134e65eea5f2dc1c415f7f76c238e13ddbe 100644
--- a/libs/middletier/SqliteMiddleTierAdminTest.cpp
+++ b/middletier/cta/SqliteMiddleTierAdminTest.cpp
@@ -1,5 +1,5 @@
-#include "SqliteMiddleTierAdmin.hpp"
-#include "SqliteMiddleTierUser.hpp"
+#include "cta/SqliteMiddleTierAdmin.hpp"
+#include "cta/SqliteMiddleTierUser.hpp"
 
 #include <gtest/gtest.h>
 
diff --git a/libs/middletier/SqliteMiddleTierUser.cpp b/middletier/cta/SqliteMiddleTierUser.cpp
similarity index 99%
rename from libs/middletier/SqliteMiddleTierUser.cpp
rename to middletier/cta/SqliteMiddleTierUser.cpp
index ce343813e00ac80bcaec05cb185a3ef5164c681d..6f1e6e24f9c5f061656076449dbbb5a83831b7cc 100644
--- a/libs/middletier/SqliteMiddleTierUser.cpp
+++ b/middletier/cta/SqliteMiddleTierUser.cpp
@@ -1,6 +1,6 @@
-#include "Exception.hpp"
-#include "SqliteMiddleTierUser.hpp"
-#include "Utils.hpp"
+#include "cta/Exception.hpp"
+#include "cta/SqliteMiddleTierUser.hpp"
+#include "cta/Utils.hpp"
 
 #include <iostream>
 #include <memory>
diff --git a/libs/middletier/SqliteMiddleTierUser.hpp b/middletier/cta/SqliteMiddleTierUser.hpp
similarity index 97%
rename from libs/middletier/SqliteMiddleTierUser.hpp
rename to middletier/cta/SqliteMiddleTierUser.hpp
index 394decb934ff572eb04a2f46fbafda1b42c57baf..080e0ee04a6c0b6fc702f7ea5c920339c9248e3b 100644
--- a/libs/middletier/SqliteMiddleTierUser.hpp
+++ b/middletier/cta/SqliteMiddleTierUser.hpp
@@ -1,11 +1,11 @@
 #pragma once
 
-#include "FileSystemNode.hpp"
-#include "FileSystemStorageClasses.hpp"
-#include "MiddleTierUser.hpp"
-#include "SqliteDatabase.hpp"
-#include "StorageClass.hpp"
-#include "Vfs.hpp"
+#include "cta/FileSystemNode.hpp"
+#include "cta/FileSystemStorageClasses.hpp"
+#include "cta/MiddleTierUser.hpp"
+#include "cta/SqliteDatabase.hpp"
+#include "cta/StorageClass.hpp"
+#include "cta/Vfs.hpp"
 
 namespace cta {
 
diff --git a/libs/middletier/SqliteMiddleTierUserTest.cpp b/middletier/cta/SqliteMiddleTierUserTest.cpp
similarity index 99%
rename from libs/middletier/SqliteMiddleTierUserTest.cpp
rename to middletier/cta/SqliteMiddleTierUserTest.cpp
index 3ab30df7b81327c0414fd403a90b8fc75eaca082..12c8e72683c450a8fc446d193e4182d9a9d49818 100644
--- a/libs/middletier/SqliteMiddleTierUserTest.cpp
+++ b/middletier/cta/SqliteMiddleTierUserTest.cpp
@@ -1,5 +1,5 @@
-#include "SqliteMiddleTierAdmin.hpp"
-#include "SqliteMiddleTierUser.hpp"
+#include "cta/SqliteMiddleTierAdmin.hpp"
+#include "cta/SqliteMiddleTierUser.hpp"
 
 #include <gtest/gtest.h>
 #include <set>
diff --git a/libs/middletier/StorageClass.cpp b/middletier/cta/StorageClass.cpp
similarity index 98%
rename from libs/middletier/StorageClass.cpp
rename to middletier/cta/StorageClass.cpp
index 312740901abfa9ace9627a9051669523c3d82d85..cca9d3002f7b66d3de2855230532b64820f1f7f6 100644
--- a/libs/middletier/StorageClass.cpp
+++ b/middletier/cta/StorageClass.cpp
@@ -1,4 +1,4 @@
-#include "StorageClass.hpp"
+#include "cta/StorageClass.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/StorageClass.hpp b/middletier/cta/StorageClass.hpp
similarity index 98%
rename from libs/middletier/StorageClass.hpp
rename to middletier/cta/StorageClass.hpp
index ad71370b9d3ca9949a59ad4c08811ee90dfbbc4a..578ea4e23890f4834a3c56b1ae69367fc21a9479 100644
--- a/libs/middletier/StorageClass.hpp
+++ b/middletier/cta/StorageClass.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <stdint.h>
 #include <string>
diff --git a/libs/middletier/Tape.cpp b/middletier/cta/Tape.cpp
similarity index 99%
rename from libs/middletier/Tape.cpp
rename to middletier/cta/Tape.cpp
index a4a66f28b0ddab831dd5b1f8349425899b5a2e5a..3ceb41c367b99821b77941e6f973c1beecea4bda 100644
--- a/libs/middletier/Tape.cpp
+++ b/middletier/cta/Tape.cpp
@@ -1,4 +1,4 @@
-#include "Tape.hpp"
+#include "cta/Tape.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/Tape.hpp b/middletier/cta/Tape.hpp
similarity index 98%
rename from libs/middletier/Tape.hpp
rename to middletier/cta/Tape.hpp
index 0d79bd970a5cb4cacc5472d149485a043f9b8a3c..b3400119180170e84536dd846afb57fd0f175691 100644
--- a/libs/middletier/Tape.hpp
+++ b/middletier/cta/Tape.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 
diff --git a/libs/middletier/TapePool.cpp b/middletier/cta/TapePool.cpp
similarity index 98%
rename from libs/middletier/TapePool.cpp
rename to middletier/cta/TapePool.cpp
index 244d8b0fdac65c2cea970cebf2c581693d3e98c9..9457fce077b1391359cf9309ea7f9fcfa10b1170 100644
--- a/libs/middletier/TapePool.cpp
+++ b/middletier/cta/TapePool.cpp
@@ -1,4 +1,4 @@
-#include "TapePool.hpp"
+#include "cta/TapePool.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/TapePool.hpp b/middletier/cta/TapePool.hpp
similarity index 98%
rename from libs/middletier/TapePool.hpp
rename to middletier/cta/TapePool.hpp
index 4bc122b19c8eb9e5012a3dd3737b4d25fe54f782..897f80c8c4f7f338016b747270f8ee4c3a864572 100644
--- a/libs/middletier/TapePool.hpp
+++ b/middletier/cta/TapePool.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 #include <string>
 
diff --git a/libs/middletier/UserIdentity.cpp b/middletier/cta/UserIdentity.cpp
similarity index 97%
rename from libs/middletier/UserIdentity.cpp
rename to middletier/cta/UserIdentity.cpp
index 637fda7d461087e994335893e943c6e2227035ec..3d4a09930e5647cfdc70225a712c6762f59f8afe 100644
--- a/libs/middletier/UserIdentity.cpp
+++ b/middletier/cta/UserIdentity.cpp
@@ -1,4 +1,4 @@
-#include "UserIdentity.hpp"
+#include "cta/UserIdentity.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/libs/middletier/UserIdentity.hpp b/middletier/cta/UserIdentity.hpp
similarity index 100%
rename from libs/middletier/UserIdentity.hpp
rename to middletier/cta/UserIdentity.hpp
diff --git a/libs/middletier/Utils.cpp b/middletier/cta/Utils.cpp
similarity index 99%
rename from libs/middletier/Utils.cpp
rename to middletier/cta/Utils.cpp
index fec9cece5e1f44be268721c7b3edbbc818e1f04d..e44f2c851bd6a47f8ed0e18d0403f6777036e524 100644
--- a/libs/middletier/Utils.cpp
+++ b/middletier/cta/Utils.cpp
@@ -1,5 +1,5 @@
-#include "Exception.hpp"
-#include "Utils.hpp"
+#include "cta/Exception.hpp"
+#include "cta/Utils.hpp"
 
 #include <sstream>
 
diff --git a/libs/middletier/Utils.hpp b/middletier/cta/Utils.hpp
similarity index 100%
rename from libs/middletier/Utils.hpp
rename to middletier/cta/Utils.hpp
diff --git a/libs/middletier/UtilsTest.cpp b/middletier/cta/UtilsTest.cpp
similarity index 99%
rename from libs/middletier/UtilsTest.cpp
rename to middletier/cta/UtilsTest.cpp
index 37ca0c54f8183cb6e96bf55f37de38791a8d49a3..f0e375a437555cd4ea4bcec4db3424a5397e630b 100644
--- a/libs/middletier/UtilsTest.cpp
+++ b/middletier/cta/UtilsTest.cpp
@@ -1,4 +1,4 @@
-#include "Utils.hpp"
+#include "cta/Utils.hpp"
 
 #include <gtest/gtest.h>
 
diff --git a/libs/middletier/Vfs.cpp b/middletier/cta/Vfs.cpp
similarity index 99%
rename from libs/middletier/Vfs.cpp
rename to middletier/cta/Vfs.cpp
index 3f9f33bfa08e72ffb2930c6396cda33944ea6212..793761ef96c9cae245af27c7c2fe618c67160661 100644
--- a/libs/middletier/Vfs.cpp
+++ b/middletier/cta/Vfs.cpp
@@ -10,9 +10,9 @@
 #include <attr/xattr.h>
 #include <fcntl.h>
 
-#include "Exception.hpp"
-#include "Utils.hpp"
-#include "Vfs.hpp"
+#include "cta/Exception.hpp"
+#include "cta/Utils.hpp"
+#include "cta/Vfs.hpp"
 
 //------------------------------------------------------------------------------
 // checkDirectoryExists
diff --git a/libs/middletier/Vfs.hpp b/middletier/cta/Vfs.hpp
similarity index 96%
rename from libs/middletier/Vfs.hpp
rename to middletier/cta/Vfs.hpp
index e3e57293d66785494d3dc8ba421aa3a39bc6682e..c452aee6ac80b752545564030e032d3078487e59 100644
--- a/libs/middletier/Vfs.hpp
+++ b/middletier/cta/Vfs.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "DirectoryIterator.hpp"
-#include "SecurityIdentity.hpp"
+#include "cta/DirectoryIterator.hpp"
+#include "cta/SecurityIdentity.hpp"
 
 namespace cta {
 
diff --git a/libs/middletier/VfsTest.cpp b/middletier/cta/VfsTest.cpp
similarity index 99%
rename from libs/middletier/VfsTest.cpp
rename to middletier/cta/VfsTest.cpp
index be358c588ebd3448b432044f519587adfe232d48..6958773c9fc709db3daf78e4f94b27114fdc3920 100644
--- a/libs/middletier/VfsTest.cpp
+++ b/middletier/cta/VfsTest.cpp
@@ -1,4 +1,4 @@
-#include "Vfs.hpp"
+#include "cta/Vfs.hpp"
 
 #include <gtest/gtest.h>
 
diff --git a/objectstore/AdminUsersList.hpp b/objectstore/AdminUsersList.hpp
index cfbf0ac42b7db0cf1a24aaa6dd188c16e2f811b9..6c5628c625d956831ecae9cb48fa2955859add64 100644
--- a/objectstore/AdminUsersList.hpp
+++ b/objectstore/AdminUsersList.hpp
@@ -1,8 +1,8 @@
 #pragma once
 
+#include "cta/AdminUser.hpp"
 #include "ObjectOps.hpp"
 #include "objectstore/cta.pb.h"
-#include "libs/middletier/AdminUser.hpp"
 
 namespace cta { namespace objectstore {
 
@@ -19,4 +19,4 @@ public:
   void add(const cta::AdminUser & adminUser);
 };
 
-}}
\ No newline at end of file
+}}
diff --git a/objectstore/CMakeLists.txt b/objectstore/CMakeLists.txt
index f24a7b4a1283b8117bd80f6a0c873e1ed1a26feb..d2a8c4507f6a5e1453734e3a0f5c362aff1bccda 100644
--- a/objectstore/CMakeLists.txt
+++ b/objectstore/CMakeLists.txt
@@ -1,6 +1,7 @@
 cmake_minimum_required (VERSION 2.6)
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../middletier)
 include_directories(${CMAKE_BINARY_DIR})
 
 find_package(Protobuf)
@@ -66,4 +67,4 @@ set(ObjectStoreUnitTests
 
 add_executable(unitTests unitTests.cpp ${ObjectStoreUnitTests})
 target_link_libraries(unitTests
-  protobuf rados CTAObjectStore gtest gmock)
\ No newline at end of file
+  protobuf rados CTAObjectStore gtest gmock)
diff --git a/objectstore/exception/Errnum.cpp b/objectstore/exception/Errnum.cpp
index 4f88157e9bf402b2cfdae0b31682b6c1f6725465..4108e3ca08bfe8946b2bb20679ffa289730836e7 100644
--- a/objectstore/exception/Errnum.cpp
+++ b/objectstore/exception/Errnum.cpp
@@ -22,8 +22,8 @@
  * @author Castor Dev team, castor-dev@cern.ch
  *****************************************************************************/
 
-#include "exception/Errnum.hpp"
-#include "exception/strerror_r_wrapper.h"
+#include "objectstore/exception/Errnum.hpp"
+#include "objectstore/exception/strerror_r_wrapper.h"
 #include <string.h>
 #include <errno.h>
 
diff --git a/objectstore/exception/Exception.cpp b/objectstore/exception/Exception.cpp
index ec6b2e3cfb0b2a5d436416a0ea11e401d34c7aaa..8f592e4e711c28b379d9fdb2d4e3f6d278013cf3 100644
--- a/objectstore/exception/Exception.cpp
+++ b/objectstore/exception/Exception.cpp
@@ -22,7 +22,7 @@
  * @author Castor Dev team, castor-dev@cern.ch
  *****************************************************************************/
 
-#include "exception/Exception.hpp"
+#include "objectstore/exception/Exception.hpp"
 
 //------------------------------------------------------------------------------
 // constructor
diff --git a/objectstore/threading/ChildProcess.hpp b/objectstore/threading/ChildProcess.hpp
index b2c4c51aab045fc583bac32f9a54f7620de60f64..594ec344bbb55c57368aca610b405d900f9db1e6 100644
--- a/objectstore/threading/ChildProcess.hpp
+++ b/objectstore/threading/ChildProcess.hpp
@@ -22,8 +22,8 @@
  *****************************************************************************/
 #pragma once
 
-#include "exception/Errnum.hpp"
-#include "exception/Exception.hpp"
+#include "objectstore/exception/Errnum.hpp"
+#include "objectstore/exception/Exception.hpp"
 #include <unistd.h>
 
 
diff --git a/objectstore/threading/Mutex.cpp b/objectstore/threading/Mutex.cpp
index 0be4f3c17f089f2a1a4fe76dd0e5920ebc9f0102..985ccf00961793ee1acbfcf9a808fc259202abcc 100644
--- a/objectstore/threading/Mutex.cpp
+++ b/objectstore/threading/Mutex.cpp
@@ -1,6 +1,6 @@
-#include "threading/Mutex.hpp"
-#include "exception/Errnum.hpp"
-#include "exception/Exception.hpp"
+#include "objectstore/threading/Mutex.hpp"
+#include "objectstore/exception/Errnum.hpp"
+#include "objectstore/exception/Exception.hpp"
 
 //------------------------------------------------------------------------------
 //constructor
diff --git a/objectstore/threading/Threading.hpp b/objectstore/threading/Threading.hpp
index fbc508d8551f154728ccc782bd38911ceb8c70a4..0c2f23aaca93df109b73dfcd204d9396608f97ac 100644
--- a/objectstore/threading/Threading.hpp
+++ b/objectstore/threading/Threading.hpp
@@ -23,11 +23,12 @@
 
 #pragma once
 
+#include "objectstore/exception/Errnum.hpp"
+#include "objectstore/exception/Exception.hpp"
+#include "objectstore/threading/Mutex.hpp"
+
 #include <pthread.h>
 #include <semaphore.h>
-#include "exception/Errnum.hpp"
-#include "exception/Exception.hpp"
-#include "threading/Mutex.hpp"
 
 namespace cta {
 namespace threading { 
diff --git a/objectstore_middletier/CMakeLists.txt b/objectstore_middletier/CMakeLists.txt
index 6df1a3271c69b6f9abdf5d2e83027b1ff8658030..ebb62593ce2a9c55c8711d98906c252f2a1bbcc5 100644
--- a/objectstore_middletier/CMakeLists.txt
+++ b/objectstore_middletier/CMakeLists.txt
@@ -1,8 +1,9 @@
 cmake_minimum_required (VERSION 2.6)
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../middletier)
 include_directories(${CMAKE_BINARY_DIR})
 
 add_library (CTAObjectStoreMiddleTier
   ObjectStoreMiddleTier.cpp
-)
\ No newline at end of file
+)
diff --git a/objectstore_middletier/ObjectStoreMiddleTier.cpp b/objectstore_middletier/ObjectStoreMiddleTier.cpp
index 5affbd7aac39e84753ed3decde0747117e4f382b..2eb3364725bc533e474df77fed74ef96964c73b6 100644
--- a/objectstore_middletier/ObjectStoreMiddleTier.cpp
+++ b/objectstore_middletier/ObjectStoreMiddleTier.cpp
@@ -1,8 +1,8 @@
+#include "cta/Exception.hpp"
 #include "ObjectStoreMiddleTier.hpp"
 #include "objectstore/Backend.hpp"
 #include "objectstore/RootEntry.hpp"
 #include "objectstore/AdminUsersList.hpp"
-#include "../libs/middletier/Exception.hpp"
 
 namespace cta {
 
diff --git a/objectstore_middletier/ObjectStoreMiddleTier.hpp b/objectstore_middletier/ObjectStoreMiddleTier.hpp
index 1683594ecb02ece5884bacc70afba90be0d72016..7fd22c7453a0d7f8137e071a0e50d537d0f2ea00 100644
--- a/objectstore_middletier/ObjectStoreMiddleTier.hpp
+++ b/objectstore_middletier/ObjectStoreMiddleTier.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "../libs/middletier/MiddleTierAdmin.hpp"
+#include "cta/MiddleTierAdmin.hpp"
 
 namespace cta {
 
diff --git a/xroot_plugins/CMakeLists.txt b/xroot_plugins/CMakeLists.txt
index e66717300455b88f406f71b6dd8ae280615655e0..27db9fbb4979715f05b0f7c58a59f0bd3e3bccfa 100644
--- a/xroot_plugins/CMakeLists.txt
+++ b/xroot_plugins/CMakeLists.txt
@@ -2,7 +2,9 @@ cmake_minimum_required (VERSION 2.6)
 
 list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 find_package (xrootd REQUIRED)
-include_directories (${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR})
+include_directories (${CMAKE_SOURCE_DIR})
+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../middletier)
+include_directories (${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR})
 
 add_library (XrdProFst MODULE XrdProFilesystem.cpp XrdProFile.cpp XrdProDir.cpp ParsedRequest.cpp)
 target_link_libraries (XrdProFst ctamiddletier)
diff --git a/xroot_plugins/XrdProDir.hpp b/xroot_plugins/XrdProDir.hpp
index 160700ea42770ab48a55a14bedab7a854d6eeb75..8a75dc622e30d0e23154f0c9091c8c8b2809f62e 100644
--- a/xroot_plugins/XrdProDir.hpp
+++ b/xroot_plugins/XrdProDir.hpp
@@ -1,11 +1,10 @@
 #pragma once
 
-#include <iostream>
-
+#include "cta/SqliteMiddleTierUser.hpp"
 #include "XrdSec/XrdSecEntity.hh"
 #include "XrdSfs/XrdSfsInterface.hh"
 
-#include "libs/middletier/SqliteMiddleTierUser.hpp"
+#include <iostream>
 
 class XrdProDir : public XrdSfsDirectory
 {
diff --git a/xroot_plugins/XrdProFilesystem.cpp b/xroot_plugins/XrdProFilesystem.cpp
index d95f5ef73d93ca31622b6083b7582805adb5da66..5d3012302d710a958afb4c75d72d3524b14255a9 100644
--- a/xroot_plugins/XrdProFilesystem.cpp
+++ b/xroot_plugins/XrdProFilesystem.cpp
@@ -1,3 +1,5 @@
+#include "cta/Exception.hpp"
+
 #include "XrdProFilesystem.hpp"
 #include "XrdProFile.hpp"
 #include "XrdProDir.hpp"
@@ -5,7 +7,6 @@
 #include "XrdOuc/XrdOucString.hh"
 #include "XrdSec/XrdSecEntity.hh"
 #include "XrdVersion.hh"
-#include "libs/middletier/Exception.hpp"
 
 #include <iostream>
 #include <pwd.h>
diff --git a/xroot_plugins/XrdProFilesystem.hpp b/xroot_plugins/XrdProFilesystem.hpp
index d844e5fc4bda2a16eb045150a5ff87b281964848..485476bedb0cbb4bf1e1b590b9c13abd5910efed 100644
--- a/xroot_plugins/XrdProFilesystem.hpp
+++ b/xroot_plugins/XrdProFilesystem.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
-#include "libs/middletier/SqliteMiddleTierAdmin.hpp"
-#include "libs/middletier/SqliteMiddleTierUser.hpp"
+#include "cta/SqliteMiddleTierAdmin.hpp"
+#include "cta/SqliteMiddleTierUser.hpp"
 #include "XrdSfs/XrdSfsInterface.hh"
 
 #include "ParsedRequest.hpp"