diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp
index f786a1347126919e2786d464675832215c0452a0..4c811b6a06906ca60b47b21de3b5b39d929bc962 100644
--- a/Applications/ApplicationsLib/ProjectData.cpp
+++ b/Applications/ApplicationsLib/ProjectData.cpp
@@ -27,8 +27,8 @@
 #include "NumLib/ODESolver/TimeDiscretizationBuilder.h"
 
 // FileIO
-#include "FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
-#include "FileIO/readMeshFromFile.h"
+#include "GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 
 #include "BaseLib/ConfigTree.h"
 
@@ -43,7 +43,7 @@ static
 void readGeometry(std::string const& fname, GeoLib::GEOObjects & geo_objects)
 {
 	DBUG("Reading geometry file \'%s\'.", fname.c_str());
-	FileIO::BoostXmlGmlInterface gml_reader(geo_objects);
+	GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
 	gml_reader.readFile(fname);
 }
 }
@@ -65,7 +65,7 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
 			project_config.getConfParam<std::string>("mesh"), project_directory
 		);
 
-	MeshLib::Mesh* const mesh = FileIO::readMeshFromFile(mesh_file);
+	MeshLib::Mesh* const mesh = MeshLib::IO::readMeshFromFile(mesh_file);
 	if (!mesh) {
 		ERR("Could not read mesh from \'%s\' file. No mesh added.",
 			mesh_file.c_str());
diff --git a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp
index 7d1c56994139b31381f1562a94ae39d37bef7703..5578d74dc36c5e281991a48869fda1dcc17fbaf6 100644
--- a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp
+++ b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp
@@ -20,7 +20,7 @@
 
 #include "DirectConditionGenerator.h"
 
-#include "AsciiRasterInterface.h"
+#include "GeoLib/IO/AsciiRasterInterface.h"
 
 #include "Raster.h"
 #include "MeshSurfaceExtraction.h"
@@ -34,7 +34,7 @@ const std::vector< std::pair<std::size_t,double> >& DirectConditionGenerator::di
 {
 	if (_direct_values.empty())
 	{
-		GeoLib::Raster* raster (FileIO::AsciiRasterInterface::readRaster(filename));
+		GeoLib::Raster* raster (GeoLib::IO::AsciiRasterInterface::readRaster(filename));
 		if (! raster) {
 			ERR("Error in DirectConditionGenerator::directToSurfaceNodes() - could not load raster file.");
 			return _direct_values;
@@ -70,7 +70,7 @@ const std::vector< std::pair<std::size_t,double> >& DirectConditionGenerator::di
 	}
 
 	std::unique_ptr<GeoLib::Raster> raster(
-	    FileIO::AsciiRasterInterface::readRaster(filename));
+	    GeoLib::IO::AsciiRasterInterface::readRaster(filename));
 	if (!raster) {
 		ERR(
 		    "Error in DirectConditionGenerator::directWithSurfaceIntegration()"
diff --git a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp
index 4443ff0dbd2d44d0bb33e7276b761dd980036824..fb2541d1afa7c9a9d156ee2da14043227ad49fea 100644
--- a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp
+++ b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp
@@ -22,7 +22,7 @@
 #include "StringTools.h"
 #include "Mesh.h"
 
-#include "FileIO/AsciiRasterInterface.h"
+#include "GeoLib/IO/AsciiRasterInterface.h"
 #include "TetGenInterface.h"
 
 #include <QCheckBox>
@@ -190,7 +190,7 @@ MeshLib::Mesh* MeshLayerEditDialog::createPrismMesh()
 		for (int i=nLayers; i>=0; --i)
 			raster_paths.push_back(this->_edits[i]->text().toStdString());
 
-		auto const rasters = FileIO::readRasters(raster_paths);
+		auto const rasters = GeoLib::IO::readRasters(raster_paths);
 		if (rasters && mapper.createLayers(*_msh, *rasters, minimum_thickness))
 		{
 			INFO("Mesh construction time: %d ms.", myTimer0.elapsed());
@@ -231,7 +231,7 @@ MeshLib::Mesh* MeshLayerEditDialog::createTetMesh()
 			raster_paths.push_back(this->_edits[i]->text().toStdString());
 		LayeredVolume lv;
 
-		auto const rasters = FileIO::readRasters(raster_paths);
+		auto const rasters = GeoLib::IO::readRasters(raster_paths);
 		if (rasters && lv.createLayers(*_msh, *rasters, minimum_thickness))
 			tg_mesh = lv.getMesh("SubsurfaceMesh").release();
 
diff --git a/Applications/DataExplorer/DataView/MshView.cpp b/Applications/DataExplorer/DataView/MshView.cpp
index 077ae0cf16222f2b951b5ed4cd63c5f75a4276f7..7ba941dd89db7a84b4d7d4f9d9b653f6f1899a7b 100644
--- a/Applications/DataExplorer/DataView/MshView.cpp
+++ b/Applications/DataExplorer/DataView/MshView.cpp
@@ -25,7 +25,7 @@
 
 #include "FileIO/SHPInterface.h"
 #include "FileIO/TetGenInterface.h"
-#include "FileIO/AsciiRasterInterface.h"
+#include "GeoLib/IO/AsciiRasterInterface.h"
 
 #include "MeshLib/Mesh.h"
 #include "MeshLib/Node.h"
@@ -166,7 +166,7 @@ void MshView::openMap2dMeshDialog()
 	if (dlg.useRasterMapping())
 	{
 		std::unique_ptr<GeoLib::Raster> raster{
-		    FileIO::AsciiRasterInterface::readRaster(dlg.getRasterPath())};
+		    GeoLib::IO::AsciiRasterInterface::readRaster(dlg.getRasterPath())};
 		if (!raster)
 		{
 			OGSError::box(QString::fromStdString(
diff --git a/Applications/DataExplorer/DataView/SaveMeshDialog.cpp b/Applications/DataExplorer/DataView/SaveMeshDialog.cpp
index b9cb8baae1395a683109e965b38292c3946fa066..f9658bdb2ed74f7032f59bd283f8f875f5224167 100644
--- a/Applications/DataExplorer/DataView/SaveMeshDialog.cpp
+++ b/Applications/DataExplorer/DataView/SaveMeshDialog.cpp
@@ -20,10 +20,9 @@
 // ThirdParty/logog
 #include "logog/include/logog.hpp"
 
-#include "FileIO/VtkIO/VtuInterface.h"
-#include "Legacy/MeshIO.h"
-
-#include "Mesh.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/Mesh.h"
 #include "OGSError.h"
 #include "LastSavedFileDirectory.h"
 
@@ -81,12 +80,12 @@ void SaveMeshDialog::accept()
 
 		int dataMode = this->dataModeBox->currentIndex();
 		bool compress (this->compressionCheckBox->isChecked());
-		FileIO::VtuInterface vtkIO(&_mesh, dataMode, compress);
+		MeshLib::IO::VtuInterface vtkIO(&_mesh, dataMode, compress);
 		vtkIO.writeToFile(file_name.toStdString().c_str());
 	}
 	if (fi.suffix().toLower() == "msh")
 	{
-		FileIO::Legacy::MeshIO meshIO;
+		MeshLib::IO::Legacy::MeshIO meshIO;
 		meshIO.setMesh(&_mesh);
 		meshIO.writeToFile(file_name.toStdString().c_str());
 	}
diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp b/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp
index 832aa19a2eb4ff2908f5befb2f25268dbab6a3fa..c7da7a18fa88b5ef1e89340c81a3f8e15224fc5f 100644
--- a/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp
+++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmProperties.cpp
@@ -22,7 +22,7 @@
 #include <vtkTexture.h>
 
 #include "VtkColorLookupTable.h"
-#include "XmlIO/Qt/XmlLutReader.h"
+#include "FileIO/XmlIO/Qt/XmlLutReader.h"
 
 VtkAlgorithmProperties::VtkAlgorithmProperties(QObject* parent /*= nullptr*/)
 	: QObject(parent)
diff --git a/Applications/DataExplorer/VtkVis/VtkCompositeColormapToImageFilter.cpp b/Applications/DataExplorer/VtkVis/VtkCompositeColormapToImageFilter.cpp
index 94da373c4815f7b0da4626e1a37d5b46b3d829d2..0fcf34a3ba0ca243ea7a7c6d62b99b520caf2f04 100644
--- a/Applications/DataExplorer/VtkVis/VtkCompositeColormapToImageFilter.cpp
+++ b/Applications/DataExplorer/VtkVis/VtkCompositeColormapToImageFilter.cpp
@@ -25,7 +25,7 @@
 #include <QFileDialog>
 
 #include "VtkColorLookupTable.h"
-#include "XmlIO/Qt/XmlLutReader.h"
+#include "FileIO/XmlIO/Qt/XmlLutReader.h"
 
 VtkCompositeColormapToImageFilter::VtkCompositeColormapToImageFilter( vtkAlgorithm* inputAlgorithm )
 	: VtkCompositeFilter(inputAlgorithm)
diff --git a/Applications/DataExplorer/VtkVis/VtkRaster.cpp b/Applications/DataExplorer/VtkVis/VtkRaster.cpp
index 269ee5c66e0e32b32313ad66dd72920415358ef7..9c2f629ed0becbd219344153eb7c9c279832f87f 100644
--- a/Applications/DataExplorer/VtkVis/VtkRaster.cpp
+++ b/Applications/DataExplorer/VtkVis/VtkRaster.cpp
@@ -36,8 +36,7 @@
 #include <memory>
 #include <logog/include/logog.hpp>
 
-#include "AsciiRasterInterface.h"
-
+#include "GeoLib/IO/AsciiRasterInterface.h"
 #include "GeoLib/Raster.h"
 
 
@@ -49,9 +48,9 @@ vtkImageAlgorithm* VtkRaster::loadImage(const std::string &fileName,
 
 	std::unique_ptr<GeoLib::Raster> raster(nullptr);
 	if (fileInfo.suffix().toLower() == "asc")
-		raster.reset(FileIO::AsciiRasterInterface::getRasterFromASCFile(fileName));
+		raster.reset(GeoLib::IO::AsciiRasterInterface::getRasterFromASCFile(fileName));
 	else if (fileInfo.suffix().toLower() == "grd")
-		raster.reset(FileIO::AsciiRasterInterface::getRasterFromSurferFile(fileName));
+		raster.reset(GeoLib::IO::AsciiRasterInterface::getRasterFromSurferFile(fileName));
 	if (raster)
 		return VtkRaster::loadImageFromArray(raster->begin(), raster->getHeader());
 	else if ((fileInfo.suffix().toLower() == "tif") || (fileInfo.suffix().toLower() == "tiff"))
diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp
index ea124e476706c91ebd13df0e117f0ad77bc822ad..f8212a173aa833aa252f3d93e7218b45b91e5597 100644
--- a/Applications/DataExplorer/mainwindow.cpp
+++ b/Applications/DataExplorer/mainwindow.cpp
@@ -24,6 +24,7 @@
 
 // GeoLib
 #include "Raster.h"
+#include "GeoLib/IO/Legacy/OGSIOVer4.h"
 
 // MeshGeoLib
 #include "MeshGeoToolsLib/GeoMapper.h"
@@ -61,15 +62,14 @@
 // FileIO includes
 #include "FileIO/FEFLOWInterface.h"
 #include "FileIO/GMSInterface.h"
-#include "FileIO/Legacy/MeshIO.h"
-#include "FileIO/Legacy/OGSIOVer4.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 #include "FileIO/GMSHInterface.h"
 #include "FileIO/TetGenInterface.h"
 #include "FileIO/PetrelInterface.h"
-#include "FileIO/XmlIO/Qt/XmlGmlInterface.h"
 #include "FileIO/XmlIO/Qt/XmlGspInterface.h"
-#include "FileIO/XmlIO/Qt/XmlStnInterface.h"
-#include "FileIO/readMeshFromFile.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlStnInterface.h"
 
 // MeshLib
 #include "Node.h"
@@ -460,7 +460,10 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName)
 		{
 			std::string unique_name;
 			std::vector<std::string> errors;
-			if (! Legacy::readGLIFileV4(fileName.toStdString(), _project.getGEOObjects(), unique_name, errors)) {
+			if (!GeoLib::IO::Legacy::readGLIFileV4(fileName.toStdString(),
+			                                       _project.getGEOObjects(),
+			                                       unique_name, errors))
+			{
 				for (std::size_t k(0); k<errors.size(); k++)
 					OGSError::box(QString::fromStdString(errors[k]));
 			}
@@ -477,14 +480,14 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName)
 		}
 		else if (fi.suffix().toLower() == "gml")
 		{
-			XmlGmlInterface xml(_project.getGEOObjects());
+			GeoLib::IO::XmlGmlInterface xml(_project.getGEOObjects());
 			if (!xml.readFile(fileName))
 				OGSError::box("Failed to load geometry.\n Please see console for details.");
 		}
 		// OpenGeoSys observation station files (incl. boreholes)
 		else if (fi.suffix().toLower() == "stn")
 		{
-			XmlStnInterface xml(_project.getGEOObjects());
+			GeoLib::IO::XmlStnInterface xml(_project.getGEOObjects());
 			if (!xml.readFile(fileName))
 				OGSError::box("Failed to load station data.\n Please see console for details.");
 
@@ -497,7 +500,7 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName)
 			myTimer0.start();
 #endif
 			std::unique_ptr<MeshLib::Mesh> mesh(
-				FileIO::readMeshFromFile(fileName.toStdString()));
+			    MeshLib::IO::readMeshFromFile(fileName.toStdString()));
 #ifndef NDEBUG
 			INFO("Mesh loading time: %d ms.", myTimer0.elapsed());
 			myTimer1.start();
@@ -779,18 +782,19 @@ void MainWindow::writeGeometryToFile(QString gliName, QString fileName)
 	QFileInfo fi(fileName);
 	if (fi.suffix().toLower() == "gli")
 	{
-		FileIO::Legacy::writeAllDataToGLIFileV4(fileName.toStdString(), this->_project.getGEOObjects());
+		GeoLib::IO::Legacy::writeAllDataToGLIFileV4(fileName.toStdString(),
+		                                            _project.getGEOObjects());
 		return;
 	}
 #endif
-	XmlGmlInterface xml(_project.getGEOObjects());
+	GeoLib::IO::XmlGmlInterface xml(_project.getGEOObjects());
 	xml.setNameForExport(gliName.toStdString());
 	xml.writeToFile(fileName.toStdString());
 }
 
 void MainWindow::writeStationListToFile(QString listName, QString fileName)
 {
-	XmlStnInterface xml(_project.getGEOObjects());
+	GeoLib::IO::XmlStnInterface xml(_project.getGEOObjects());
 	xml.setNameForExport(listName.toStdString());
 	xml.writeToFile(fileName.toStdString());
 }
@@ -835,7 +839,7 @@ void MainWindow::mapGeometry(const std::string &geo_name)
 	if (choice == 0) // load mesh from file
 	{
 		if (fi.suffix().toLower() == "vtu" || fi.suffix().toLower() == "msh")
-			mesh = FileIO::readMeshFromFile(file_name.toStdString());
+			mesh = MeshLib::IO::readMeshFromFile(file_name.toStdString());
 		else
 		{
 			OGSError::box("The selected file is no supported mesh file.");
diff --git a/Applications/Utils/FileConverter/CMakeLists.txt b/Applications/Utils/FileConverter/CMakeLists.txt
index 452da058b22e22843c84fc5336c7cee2e6564c2f..f09387d0f16f0f332b66e84d42e91a97a9d69cdf 100644
--- a/Applications/Utils/FileConverter/CMakeLists.txt
+++ b/Applications/Utils/FileConverter/CMakeLists.txt
@@ -9,47 +9,48 @@ include_directories(
 	${CMAKE_SOURCE_DIR}/Gui/OpenSG
 )
 
-if (QT4_FOUND)
+if (QT4_FOUND AND Shapelib_FOUND)
 	add_executable(ConvertSHPToGLI ConvertSHPToGLI.cpp)
 	set_target_properties(ConvertSHPToGLI PROPERTIES FOLDER Utilities)
+    target_link_libraries(ConvertSHPToGLI GeoLib Qt4::QtXml ${Shapelib_LIBRARIES})
+endif ()
 
-	target_link_libraries(ConvertSHPToGLI FileIO)
-
+if (QT4_FOUND)
 	add_executable(FEFLOW2OGS FEFLOW2OGS.cpp)
 	set_target_properties(FEFLOW2OGS PROPERTIES FOLDER Utilities)
-	target_link_libraries(FEFLOW2OGS FileIO)
+	target_link_libraries(FEFLOW2OGS FileIO MeshLib)
 	ADD_VTK_DEPENDENCY(FEFLOW2OGS)
-endif () # QT4_FOUND
+endif ()
 
 add_executable(generateMatPropsFromMatID generateMatPropsFromMatID.cpp )
-target_link_libraries(generateMatPropsFromMatID FileIO)
+target_link_libraries(generateMatPropsFromMatID MeshLib)
 ADD_VTK_DEPENDENCY(generateMatPropsFromMatID)
 set_target_properties(generateMatPropsFromMatID
 	PROPERTIES FOLDER Utilities)
 
 add_executable(GMSH2OGS GMSH2OGS.cpp)
 set_target_properties(GMSH2OGS PROPERTIES FOLDER Utilities)
-target_link_libraries(GMSH2OGS FileIO )
+target_link_libraries(GMSH2OGS MeshLib FileIO)
 ADD_VTK_DEPENDENCY(GMSH2OGS)
 
 add_executable(OGS2VTK OGS2VTK.cpp)
 set_target_properties(OGS2VTK PROPERTIES FOLDER Utilities)
-target_link_libraries(OGS2VTK FileIO)
+target_link_libraries(OGS2VTK MeshLib)
 ADD_VTK_DEPENDENCY(OGS2VTK)
 
 add_executable(VTK2OGS VTK2OGS.cpp)
 set_target_properties(VTK2OGS PROPERTIES FOLDER Utilities)
-target_link_libraries(VTK2OGS FileIO)
+target_link_libraries(VTK2OGS MeshLib)
 ADD_VTK_DEPENDENCY(VTK2OGS)
 
 add_executable(VTK2TIN VTK2TIN.cpp)
 set_target_properties(VTK2TIN PROPERTIES FOLDER Utilities)
-target_link_libraries(VTK2TIN FileIO)
+target_link_libraries(VTK2TIN MeshLib)
 ADD_VTK_DEPENDENCY(VTK2TIN)
 
 add_executable(TIN2VTK TIN2VTK.cpp)
 set_target_properties(TIN2VTK PROPERTIES FOLDER Utilities)
-target_link_libraries(TIN2VTK FileIO)
+target_link_libraries(TIN2VTK MeshLib)
 ADD_VTK_DEPENDENCY(TIN2VTK)
 
 ####################
diff --git a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp
index 1daacdf9a3a527e8ba3a5cd51ad260c7b83f0b63..c48647d7340b934cb86a25ea7f1980a268237072 100644
--- a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp
+++ b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp
@@ -29,9 +29,8 @@
 // BaseLib
 #include "LogogSimpleFormatter.h"
 
-// FileIO
-#include "XmlIO/Qt/XmlGmlInterface.h"
-#include "XmlIO/Qt/XmlStnInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlStnInterface.h"
 
 // GeoLib
 #include "GEOObjects.h"
@@ -88,11 +87,11 @@ void convertPoints (DBFHandle dbf_handle,
 		geo_objs.addPointVec(std::move(points), points_group_name);
 
 	if (station) {
-		FileIO::XmlStnInterface xml (geo_objs);
+		GeoLib::IO::XmlStnInterface xml (geo_objs);
 		xml.setNameForExport(points_group_name);
 		xml.writeToFile(out_fname);
 	} else {
-		FileIO::XmlGmlInterface xml (geo_objs);
+		GeoLib::IO::XmlGmlInterface xml (geo_objs);
 		xml.setNameForExport(points_group_name);
 		xml.writeToFile(out_fname);
 	}
diff --git a/Applications/Utils/FileConverter/FEFLOW2OGS.cpp b/Applications/Utils/FileConverter/FEFLOW2OGS.cpp
index 9c5b6a4698bf8fd194d8af03ea1047dcaf9fad4b..69ee3843d28d9454389bd5e996c0023563b79dbc 100644
--- a/Applications/Utils/FileConverter/FEFLOW2OGS.cpp
+++ b/Applications/Utils/FileConverter/FEFLOW2OGS.cpp
@@ -25,10 +25,10 @@
 #include "BaseLib/LogogSimpleFormatter.h"
 
 // FileIO
-#include "FileIO/writeMeshToFile.h"
-#include "FileIO/Legacy/MeshIO.h"
+#include "MeshLib/IO/writeMeshToFile.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
 #include "FileIO/FEFLOWInterface.h"
-#include "FileIO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 // MeshLib
 #include "MeshLib/Mesh.h"
@@ -87,7 +87,7 @@ int main (int argc, char* argv[])
 	// *** write mesh in new format
 	std::string ogs_mesh_fname(ogs_mesh_arg.getValue());
 	INFO("Writing %s.", ogs_mesh_fname.c_str());
-	FileIO::writeMeshToFile(*mesh, ogs_mesh_fname);
+	MeshLib::IO::writeMeshToFile(*mesh, ogs_mesh_fname);
 
 	INFO("\tDone.");
 
diff --git a/Applications/Utils/FileConverter/GMSH2OGS.cpp b/Applications/Utils/FileConverter/GMSH2OGS.cpp
index d6ec2921d87c79d23eeb28dee31f416ad579feaf..73433fb0e3fc1aadddd9ad55950da564a0937f63 100644
--- a/Applications/Utils/FileConverter/GMSH2OGS.cpp
+++ b/Applications/Utils/FileConverter/GMSH2OGS.cpp
@@ -32,8 +32,8 @@
 
 // FileIO
 #include "FileIO/GMSHInterface.h"
-#include "FileIO/Legacy/MeshIO.h"
-#include "FileIO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 // MeshLib
 #include "MeshLib/MeshSearch/ElementSearch.h"
@@ -113,7 +113,7 @@ int main (int argc, char* argv[])
 	std::string ogs_mesh_fname(ogs_mesh_arg.getValue());
 	if (BaseLib::getFileExtension(ogs_mesh_fname).compare("msh") == 0) {
 		INFO("Writing %s.", ogs_mesh_fname.c_str());
-		FileIO::Legacy::MeshIO mesh_io;
+		MeshLib::IO::Legacy::MeshIO mesh_io;
 		mesh_io.setMesh(mesh);
 		mesh_io.writeToFile(ogs_mesh_fname);
 	} else {
@@ -121,7 +121,7 @@ int main (int argc, char* argv[])
 			ogs_mesh_fname += ".vtu";
 		}
 		INFO("Writing %s.", ogs_mesh_fname.c_str());
-		FileIO::VtuInterface mesh_io(mesh);
+		MeshLib::IO::VtuInterface mesh_io(mesh);
 		mesh_io.writeToFile(ogs_mesh_fname);
 	}
 	INFO("\tDone.");
diff --git a/Applications/Utils/FileConverter/OGS2VTK.cpp b/Applications/Utils/FileConverter/OGS2VTK.cpp
index 47a07295103bddb4f8bc00e3a05f0f47309369a5..4b8260390a06cf4e3ef42e2d016e51fcc0b71a69 100644
--- a/Applications/Utils/FileConverter/OGS2VTK.cpp
+++ b/Applications/Utils/FileConverter/OGS2VTK.cpp
@@ -24,8 +24,8 @@
 #include "LogogSimpleFormatter.h"
 
 // FileIO
-#include "FileIO/VtkIO/VtuInterface.h"
-#include "readMeshFromFile.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 
 // MeshLib
 #include "Mesh.h"
@@ -48,10 +48,10 @@ int main (int argc, char* argv[])
 	cmd.add(mesh_out);
 	cmd.parse(argc, argv);
 
-	MeshLib::Mesh* mesh (FileIO::readMeshFromFile(mesh_in.getValue()));
+	MeshLib::Mesh* mesh (MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements());
 
-	FileIO::VtuInterface vtu(mesh);
+	MeshLib::IO::VtuInterface vtu(mesh);
 	vtu.writeToFile(mesh_out.getValue());
 
 	delete custom_format;
diff --git a/Applications/Utils/FileConverter/TIN2VTK.cpp b/Applications/Utils/FileConverter/TIN2VTK.cpp
index 6b48164fb3250e0f53350bdd35496cff7500cc11..a839ab5d2fcb4578a52605e449b972a0e3679619 100644
--- a/Applications/Utils/FileConverter/TIN2VTK.cpp
+++ b/Applications/Utils/FileConverter/TIN2VTK.cpp
@@ -26,10 +26,10 @@
 #include "GeoLib/Point.h"
 #include "GeoLib/Surface.h"
 #include "GeoLib/PointVec.h"
+#include "GeoLib/IO/TINInterface.h"
 
 // FileIO
-#include "FileIO/VtkIO/VtuInterface.h"
-#include "FileIO/TINInterface.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 // MeshLib
 #include "MeshLib/Mesh.h"
@@ -59,7 +59,8 @@ int main (int argc, char* argv[])
 	auto pnt_vec = std::unique_ptr<std::vector<GeoLib::Point*>>(
 	    new std::vector<GeoLib::Point*>);
 	GeoLib::PointVec point_vec("SurfacePoints", std::move(pnt_vec));
-	std::unique_ptr<GeoLib::Surface> sfc(FileIO::TINInterface::readTIN(tinFileName, point_vec));
+	std::unique_ptr<GeoLib::Surface> sfc(
+	    GeoLib::IO::TINInterface::readTIN(tinFileName, point_vec));
 	if (!sfc)
 		return 1;
 	INFO("TIN read:  %d points, %d triangles", pnt_vec->size(), sfc->getNTriangles());
@@ -69,7 +70,7 @@ int main (int argc, char* argv[])
 	INFO("Mesh created: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements());
 
 	INFO("Write it into VTU");
-	FileIO::VtuInterface writer(mesh.get());
+	MeshLib::IO::VtuInterface writer(mesh.get());
 	writer.writeToFile(outArg.getValue());
 
 	delete custom_format;
diff --git a/Applications/Utils/FileConverter/VTK2OGS.cpp b/Applications/Utils/FileConverter/VTK2OGS.cpp
index 458b41a1702d46fcf42d5ef599e8921e43e86da9..7e902882b705297294d92473fdd8ac057b620fdc 100644
--- a/Applications/Utils/FileConverter/VTK2OGS.cpp
+++ b/Applications/Utils/FileConverter/VTK2OGS.cpp
@@ -24,11 +24,10 @@
 #include "LogogSimpleFormatter.h"
 
 // FileIO
-#include "FileIO/VtkIO/VtuInterface.h"
-#include "Legacy/MeshIO.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
-// MeshLib
-#include "Mesh.h"
+#include "MeshLib/Mesh.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
 
 int main (int argc, char* argv[])
 {
@@ -48,10 +47,10 @@ int main (int argc, char* argv[])
 	cmd.add(mesh_out);
 	cmd.parse(argc, argv);
 
-	MeshLib::Mesh* mesh (FileIO::VtuInterface::readVTUFile(mesh_in.getValue()));
+	MeshLib::Mesh* mesh (MeshLib::IO::VtuInterface::readVTUFile(mesh_in.getValue()));
 	INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements());
 
-	FileIO::Legacy::MeshIO meshIO;
+	MeshLib::IO::Legacy::MeshIO meshIO;
 	meshIO.setMesh(mesh);
 	meshIO.writeToFile(mesh_out.getValue());
 
diff --git a/Applications/Utils/FileConverter/VTK2TIN.cpp b/Applications/Utils/FileConverter/VTK2TIN.cpp
index 583152c06dad8709029d236d0e6ac6302c85ac8b..5352fc93909f844973d38ed2304261f8b2ef41c1 100644
--- a/Applications/Utils/FileConverter/VTK2TIN.cpp
+++ b/Applications/Utils/FileConverter/VTK2TIN.cpp
@@ -24,6 +24,7 @@
 // GeoLib
 #include "GeoLib/GEOObjects.h"
 #include "GeoLib/Surface.h"
+#include "GeoLib/IO/TINInterface.h"
 
 // MeshLib
 #include "MeshLib/Mesh.h"
@@ -32,8 +33,7 @@
 #include "MeshLib/convertMeshToGeo.h"
 
 // FileIO
-#include "FileIO/VtkIO/VtuInterface.h"
-#include "FileIO/TINInterface.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 
 int main (int argc, char* argv[])
@@ -54,14 +54,16 @@ int main (int argc, char* argv[])
 	cmd.add(mesh_out);
 	cmd.parse(argc, argv);
 
-	std::unique_ptr<MeshLib::Mesh> mesh (FileIO::VtuInterface::readVTUFile(mesh_in.getValue()));
+	std::unique_ptr<MeshLib::Mesh> mesh (MeshLib::IO::VtuInterface::readVTUFile(mesh_in.getValue()));
 	INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements());
 
 	INFO("Converting the mesh to TIN");
 	GeoLib::GEOObjects geo_objects;
 	if (MeshLib::convertMeshToGeo(*mesh, geo_objects)) {
 		INFO("Writing TIN into the file");
-		FileIO::TINInterface::writeSurfaceAsTIN(*(*geo_objects.getSurfaceVec(mesh->getName()))[0], mesh_out.getValue());
+		GeoLib::IO::TINInterface::writeSurfaceAsTIN(
+		    *(*geo_objects.getSurfaceVec(mesh->getName()))[0],
+		    mesh_out.getValue());
 	}
 
 	delete custom_format;
diff --git a/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp b/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp
index 4a90b0c630bf9215b2ed9af837446ad8d21ac933..eeb52cb820d03323876e34eccbe3122e76e62d68 100644
--- a/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp
+++ b/Applications/Utils/FileConverter/generateMatPropsFromMatID.cpp
@@ -23,8 +23,8 @@
 
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 #include "MeshLib/Mesh.h"
 #include "MeshLib/Elements/Element.h"
@@ -49,7 +49,7 @@ int main (int argc, char* argv[])
 	cmd.parse( argc, argv );
 
 	// read mesh
-	std::unique_ptr<MeshLib::Mesh> mesh(FileIO::readMeshFromFile(mesh_arg.getValue()));
+	std::unique_ptr<MeshLib::Mesh> mesh(MeshLib::IO::readMeshFromFile(mesh_arg.getValue()));
 	if (!mesh) {
 		INFO("Could not read mesh from file \"%s\".", mesh_arg.getValue().c_str());
 		return EXIT_FAILURE;
@@ -87,7 +87,7 @@ int main (int argc, char* argv[])
 
 	std::string const new_mshname(name + "_new.vtu");
 	INFO("Writing mesh to file \"%s\".", new_mshname.c_str());
-	FileIO::writeMeshToFile(*mesh, new_mshname);
+	MeshLib::IO::writeMeshToFile(*mesh, new_mshname);
 
 	INFO("New files \"%s\" and \"%s\" written.", new_mshname.c_str(), new_matname.c_str());
 	std::cout << "Conversion finished." << std::endl;
diff --git a/Applications/Utils/GeoTools/CMakeLists.txt b/Applications/Utils/GeoTools/CMakeLists.txt
index a63a3a0428c7a064ac33ee76bdce672158960444..7b2b1c3b86befb27cf2d4bb5433990acec924ce3 100644
--- a/Applications/Utils/GeoTools/CMakeLists.txt
+++ b/Applications/Utils/GeoTools/CMakeLists.txt
@@ -7,7 +7,7 @@ include_directories(
 
 if(QT4_FOUND)
 	add_executable(TriangulatePolyline TriangulatePolyline.cpp)
-	target_link_libraries(TriangulatePolyline FileIO)
+	target_link_libraries(TriangulatePolyline GeoLib)
 	set_target_properties(TriangulatePolyline PROPERTIES FOLDER Utilities)
 	install(TARGETS
 		TriangulatePolyline
@@ -16,7 +16,7 @@ if(QT4_FOUND)
 	)
 
 	add_executable(MoveGeometry MoveGeometry.cpp)
-	target_link_libraries(MoveGeometry FileIO)
+	target_link_libraries(MoveGeometry GeoLib)
 	set_target_properties(MoveGeometry PROPERTIES FOLDER Utilities)
 	install(TARGETS
 		MoveGeometry
diff --git a/Applications/Utils/GeoTools/MoveGeometry.cpp b/Applications/Utils/GeoTools/MoveGeometry.cpp
index 8eb08452b88de996045ca4540c3367942fa53a38..af34d35dffa914b859bb0afbcb02e3b8934b2d87 100644
--- a/Applications/Utils/GeoTools/MoveGeometry.cpp
+++ b/Applications/Utils/GeoTools/MoveGeometry.cpp
@@ -19,7 +19,7 @@
 
 #include "BaseLib/LogogSimpleFormatter.h"
 #include "MathLib/Vector3.h"
-#include "FileIO/XmlIO/Qt/XmlGmlInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
 #include "GeoLib/GEOObjects.h"
 
 #include <QCoreApplication>
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
 	cmd.parse( argc, argv );
 
 	GeoLib::GEOObjects geo_objects;
-	FileIO::XmlGmlInterface xml(geo_objects);
+	GeoLib::IO::XmlGmlInterface xml(geo_objects);
 	if (!xml.readFile(geo_input_arg.getValue()))
 	{
 		delete logogCout;
diff --git a/Applications/Utils/GeoTools/TriangulatePolyline.cpp b/Applications/Utils/GeoTools/TriangulatePolyline.cpp
index 61be7b5261345fc3a599371b891c32c99db5cb5f..c8249e712b288504cd9e7793b112af040a3e83e3 100644
--- a/Applications/Utils/GeoTools/TriangulatePolyline.cpp
+++ b/Applications/Utils/GeoTools/TriangulatePolyline.cpp
@@ -18,7 +18,7 @@
 
 #include "BaseLib/BuildInfo.h"
 #include "BaseLib/LogogSimpleFormatter.h"
-#include "FileIO/XmlIO/Qt/XmlGmlInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
 #include "GeoLib/AnalyticalGeometry.h"
 #include "GeoLib/GEOObjects.h"
 #include "GeoLib/Polyline.h"
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
 	std::string const& polyline_name(name_arg.getValue());
 
 	GeoLib::GEOObjects geo_objects;
-	FileIO::XmlGmlInterface xml(geo_objects);
+	GeoLib::IO::XmlGmlInterface xml(geo_objects);
 	if (!xml.readFile(file_name))
 	{
 		ERR ("Failed to load geometry file.");
diff --git a/Applications/Utils/MeshEdit/AddTopLayer.cpp b/Applications/Utils/MeshEdit/AddTopLayer.cpp
index 38d3a9b9b929e4e8e01e0cf4a557851a99b2fc0b..292f6e5aa90fd105078c420290f9c936e2f38c4f 100644
--- a/Applications/Utils/MeshEdit/AddTopLayer.cpp
+++ b/Applications/Utils/MeshEdit/AddTopLayer.cpp
@@ -18,8 +18,8 @@
 
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 #include "MeshLib/Mesh.h"
 #include "MeshLib/MeshEditing/AddLayerToMesh.h"
@@ -52,7 +52,7 @@ int main (int argc, char* argv[])
 
 	INFO("Reading mesh \"%s\" ... ", mesh_arg.getValue().c_str());
 	auto subsfc_mesh = std::unique_ptr<MeshLib::Mesh>(
-	    FileIO::readMeshFromFile(mesh_arg.getValue()));
+	    MeshLib::IO::readMeshFromFile(mesh_arg.getValue()));
 	if (!subsfc_mesh) {
 		ERR("Error reading mesh \"%s\".", mesh_arg.getValue().c_str());
 		return EXIT_FAILURE;
@@ -67,7 +67,7 @@ int main (int argc, char* argv[])
 	}
 
 	INFO("Writing mesh \"%s\" ... ", mesh_out_arg.getValue().c_str());
-	FileIO::writeMeshToFile(*result, mesh_out_arg.getValue());
+	MeshLib::IO::writeMeshToFile(*result, mesh_out_arg.getValue());
 	INFO("done.");
 
 	return EXIT_SUCCESS;
diff --git a/Applications/Utils/MeshEdit/CMakeLists.txt b/Applications/Utils/MeshEdit/CMakeLists.txt
index 480cd80039387328ac1b7f1b5a8b9dfb370027b3..a662a8a6819a9c5eac811cac2638518696e6bc69 100644
--- a/Applications/Utils/MeshEdit/CMakeLists.txt
+++ b/Applications/Utils/MeshEdit/CMakeLists.txt
@@ -9,78 +9,78 @@ include_directories(
 )
 
 add_executable(moveMeshNodes moveMeshNodes.cpp)
-target_link_libraries(moveMeshNodes FileIO)
+target_link_libraries(moveMeshNodes MeshLib)
 ADD_VTK_DEPENDENCY(moveMeshNodes)
 set_target_properties(moveMeshNodes PROPERTIES FOLDER Utilities)
 
 add_executable(MapGeometryToMeshSurface
 	MapGeometryToMeshSurface.cpp )
-target_link_libraries(MapGeometryToMeshSurface FileIO MeshGeoToolsLib)
+target_link_libraries(MapGeometryToMeshSurface MeshGeoToolsLib)
 ADD_VTK_DEPENDENCY(MapGeometryToMeshSurface)
 set_target_properties(MapGeometryToMeshSurface PROPERTIES FOLDER Utilities)
 
 add_executable(removeMeshElements removeMeshElements.cpp)
-target_link_libraries(removeMeshElements FileIO)
+target_link_libraries(removeMeshElements MeshLib)
 ADD_VTK_DEPENDENCY(removeMeshElements)
 set_target_properties(removeMeshElements PROPERTIES FOLDER Utilities)
 
 add_executable(NodeReordering NodeReordering.cpp)
-target_link_libraries(NodeReordering FileIO)
+target_link_libraries(NodeReordering MeshLib)
 ADD_VTK_DEPENDENCY(NodeReordering)
 set_target_properties(NodeReordering PROPERTIES FOLDER Utilities)
 
 add_executable(MoveMesh MoveMesh.cpp)
-target_link_libraries(MoveMesh FileIO)
+target_link_libraries(MoveMesh MeshLib)
 ADD_VTK_DEPENDENCY(MoveMesh)
 set_target_properties(MoveMesh PROPERTIES FOLDER Utilities)
 
 add_executable(appendLinesAlongPolyline appendLinesAlongPolyline.cpp)
-target_link_libraries(appendLinesAlongPolyline FileIO MeshGeoToolsLib)
+target_link_libraries(appendLinesAlongPolyline MeshGeoToolsLib)
 ADD_VTK_DEPENDENCY(appendLinesAlongPolyline)
 set_target_properties(appendLinesAlongPolyline PROPERTIES FOLDER Utilities)
 
 add_executable(editMaterialID editMaterialID.cpp)
-target_link_libraries(editMaterialID FileIO)
+target_link_libraries(editMaterialID MeshLib)
 ADD_VTK_DEPENDENCY(editMaterialID)
 set_target_properties(editMaterialID PROPERTIES FOLDER Utilities)
 
 add_executable(checkMesh checkMesh.cpp)
-target_link_libraries(checkMesh FileIO)
+target_link_libraries(checkMesh MeshLib)
 ADD_VTK_DEPENDENCY(checkMesh)
 set_target_properties(checkMesh PROPERTIES FOLDER Utilities)
 
 add_executable(reviseMesh reviseMesh.cpp)
-target_link_libraries (reviseMesh FileIO)
+target_link_libraries (reviseMesh MeshLib)
 ADD_VTK_DEPENDENCY(reviseMesh)
 set_target_properties(reviseMesh PROPERTIES FOLDER Utilities)
 
 add_executable(ResetPropertiesInPolygonalRegion
 	ResetPropertiesInPolygonalRegion.cpp)
-target_link_libraries(ResetPropertiesInPolygonalRegion FileIO)
+target_link_libraries(ResetPropertiesInPolygonalRegion MeshLib)
 set_target_properties(ResetPropertiesInPolygonalRegion
 	PROPERTIES FOLDER Utilities)
 
 add_executable(AddTopLayer AddTopLayer.cpp)
-target_link_libraries(AddTopLayer FileIO)
+target_link_libraries(AddTopLayer MeshLib)
 set_target_properties(AddTopLayer PROPERTIES FOLDER Utilities)
 
 add_executable(createLayeredMeshFromRasters createLayeredMeshFromRasters.cpp)
-target_link_libraries(createLayeredMeshFromRasters FileIO)
+target_link_libraries(createLayeredMeshFromRasters MeshLib)
 set_target_properties(createLayeredMeshFromRasters PROPERTIES FOLDER Utilities)
 
 add_executable(CreateBoundaryConditionsAlongPolylines
 	CreateBoundaryConditionsAlongPolylines.cpp )
-target_link_libraries(CreateBoundaryConditionsAlongPolylines FileIO MeshGeoToolsLib)
+target_link_libraries(CreateBoundaryConditionsAlongPolylines MeshGeoToolsLib)
 ADD_VTK_DEPENDENCY(CreateBoundaryConditionsAlongPolylines)
 set_target_properties(CreateBoundaryConditionsAlongPolylines
 	PROPERTIES FOLDER Utilities)
 
 add_executable(queryMesh queryMesh.cpp)
-target_link_libraries(queryMesh FileIO)
+target_link_libraries(queryMesh MeshLib)
 set_target_properties(queryMesh PROPERTIES FOLDER Utilities)
 
 add_executable(ExtractSurface ExtractSurface.cpp)
-target_link_libraries(ExtractSurface FileIO MeshLib)
+target_link_libraries(ExtractSurface MeshLib)
 set_target_properties(ExtractSurface PROPERTIES FOLDER Utilities)
 
 ####################
diff --git a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
index bd0adc989b8d2a45afeff5bd70fac470b8153091..474c1cc307405690ed4c3bec5f704258649740cc 100644
--- a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
+++ b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
@@ -26,14 +26,14 @@
 #include "BaseLib/FileTools.h"
 
 // FileIO
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
-#include "FileIO/readGeometryFromFile.h"
-#include "FileIO/writeGeometryToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 // GeoLib
 #include "GeoLib/GEOObjects.h"
 #include "GeoLib/Point.h"
+#include "GeoLib/IO/readGeometryFromFile.h"
+#include "GeoLib/IO/writeGeometryToFile.h"
 
 // MeshLib
 #include "MeshLib/Mesh.h"
@@ -101,9 +101,9 @@ void writeBCsAndGeometry(GeoLib::GEOObjects& geometry_sets,
 {
 	if (write_gml) {
 		INFO("write points to \"%s.gml\".", geo_name.c_str());
-		FileIO::writeGeometryToFile(geo_name, geometry_sets, out_fname+".gml");
+		GeoLib::IO::writeGeometryToFile(geo_name, geometry_sets, out_fname+".gml");
 	}
-	FileIO::writeGeometryToFile(geo_name, geometry_sets, out_fname+".gli");
+	GeoLib::IO::writeGeometryToFile(geo_name, geometry_sets, out_fname+".gli");
 
 	bool liquid_flow(false);
 	if (bc_type == "LIQUID_FLOW")
@@ -173,7 +173,7 @@ int main (int argc, char* argv[])
 
 	// *** read mesh
 	INFO("Reading mesh \"%s\" ... ", mesh_arg.getValue().c_str());
-	MeshLib::Mesh * subsurface_mesh(FileIO::readMeshFromFile(mesh_arg.getValue()));
+	MeshLib::Mesh * subsurface_mesh(MeshLib::IO::readMeshFromFile(mesh_arg.getValue()));
 	INFO("done.");
 	INFO("Extracting top surface of mesh \"%s\" ... ",
 		mesh_arg.getValue().c_str());
@@ -188,7 +188,7 @@ int main (int argc, char* argv[])
 
 	// *** read geometry
 	GeoLib::GEOObjects geometries;
-	FileIO::readGeometryFromFile(geometry_fname.getValue(), geometries);
+	GeoLib::IO::readGeometryFromFile(geometry_fname.getValue(), geometries);
 
 	std::string geo_name;
 	{
diff --git a/Applications/Utils/MeshEdit/ExtractSurface.cpp b/Applications/Utils/MeshEdit/ExtractSurface.cpp
index 3b1875eba4025a30e846fcb3ea1d129423a077e4..47a36c0907030da99883ce5e7e7c283b4fbe08e4 100644
--- a/Applications/Utils/MeshEdit/ExtractSurface.cpp
+++ b/Applications/Utils/MeshEdit/ExtractSurface.cpp
@@ -20,8 +20,8 @@
 #include "BaseLib/StringTools.h"
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 #include "MathLib/Vector3.h"
 
@@ -61,7 +61,7 @@ int main (int argc, char* argv[])
 	cmd.parse(argc, argv);
 
 	std::unique_ptr<MeshLib::Mesh const> mesh(
-	    FileIO::readMeshFromFile(mesh_in.getValue()));
+	    MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	INFO("Mesh read: %u nodes, %u elements.", mesh->getNNodes(), mesh->getNElements());
 
 	// extract surface
@@ -74,7 +74,7 @@ int main (int argc, char* argv[])
 	std::string out_fname(mesh_out.getValue());
 	if (out_fname.empty())
 		out_fname = BaseLib::dropFileExtension(mesh_in.getValue()) + "_sfc.vtu";
-	FileIO::writeMeshToFile(*surface_mesh, out_fname);
+	MeshLib::IO::writeMeshToFile(*surface_mesh, out_fname);
 
 	return EXIT_SUCCESS;
 }
diff --git a/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp b/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp
index 345402610d2233c906bc626f3cf7c3e8a1511515..2f909691a4581a14466730c440c6a8616fca07bf 100644
--- a/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp
+++ b/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp
@@ -23,8 +23,8 @@
 #include "BaseLib/LogogSimpleFormatter.h"
 
 // FileIO
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h"
 
 // GeoLib
 #include "GeoLib/GEOObjects.h"
@@ -66,12 +66,12 @@ int main (int argc, char* argv[])
 	cmd.parse(argc, argv);
 
 	// *** read mesh
-	MeshLib::Mesh * mesh(FileIO::readMeshFromFile(mesh_in.getValue()));
+	MeshLib::Mesh * mesh(MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 
 	// *** read geometry
 	GeoLib::GEOObjects geometries;
 	{
-		FileIO::BoostXmlGmlInterface xml_io(geometries);
+		GeoLib::IO::BoostXmlGmlInterface xml_io(geometries);
 		if (xml_io.readFile(input_geometry_fname.getValue())) {
 			INFO("Read geometry from file \"%s\".",
 				input_geometry_fname.getValue().c_str());
@@ -98,7 +98,7 @@ int main (int argc, char* argv[])
 	}
 
 	{
-		FileIO::BoostXmlGmlInterface xml_io(geometries);
+		GeoLib::IO::BoostXmlGmlInterface xml_io(geometries);
 		xml_io.setNameForExport(new_geo_name);
 		xml_io.writeToFile(output_geometry_fname.getValue());
 	}
diff --git a/Applications/Utils/MeshEdit/MoveMesh.cpp b/Applications/Utils/MeshEdit/MoveMesh.cpp
index 474a4b3af3c9541645439f7fac1ee5da302811e7..88d0234492435157870c52d62b544a4ae226c137 100644
--- a/Applications/Utils/MeshEdit/MoveMesh.cpp
+++ b/Applications/Utils/MeshEdit/MoveMesh.cpp
@@ -22,8 +22,8 @@
 #include "LogogSimpleFormatter.h"
 
 // FileIO
-#include "readMeshFromFile.h"
-#include "FileIO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 // GeoLib
 #include "AABB.h"
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
 
 	std::string fname (mesh_arg.getValue());
 
-	MeshLib::Mesh* mesh = FileIO::readMeshFromFile(fname);
+	MeshLib::Mesh* mesh = MeshLib::IO::readMeshFromFile(fname);
 
 	MeshLib::Node displacement(0.0, 0.0, 0.0);
 	if (fabs(x_arg.getValue()) < std::numeric_limits<double>::epsilon()
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
 		out_fname += "_displaced.vtu";
 	}
 
-	FileIO::VtuInterface mesh_io(mesh);
+	MeshLib::IO::VtuInterface mesh_io(mesh);
 	mesh_io.writeToFile(out_fname);
 
 	delete mesh;
diff --git a/Applications/Utils/MeshEdit/NodeReordering.cpp b/Applications/Utils/MeshEdit/NodeReordering.cpp
index 2d152f061aa553679e402d452dba8ecd231cffbb..ecaf4d2d9410483dd76121c68bd768bc6f2d3951 100644
--- a/Applications/Utils/MeshEdit/NodeReordering.cpp
+++ b/Applications/Utils/MeshEdit/NodeReordering.cpp
@@ -18,8 +18,8 @@
 
 #include "Applications/ApplicationsLib/LogogSetup.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 #include "MeshLib/Mesh.h"
 #include "MeshLib/Elements/Element.h"
@@ -107,7 +107,7 @@ int main (int argc, char* argv[])
 	cmd.add(method_arg);
 	cmd.parse(argc, argv);
 
-	std::unique_ptr<MeshLib::Mesh> mesh(FileIO::readMeshFromFile(input_mesh_arg.getValue().c_str()));
+	std::unique_ptr<MeshLib::Mesh> mesh(MeshLib::IO::readMeshFromFile(input_mesh_arg.getValue().c_str()));
 
 	INFO("Reordering nodes... ");
 	if (!method_arg.isSet() || method_arg.getValue() == 1)
@@ -120,7 +120,7 @@ int main (int argc, char* argv[])
 		return EXIT_FAILURE;
 	}
 
-	FileIO::writeMeshToFile(*mesh, output_mesh_arg.getValue().c_str());
+	MeshLib::IO::writeMeshToFile(*mesh, output_mesh_arg.getValue().c_str());
 
 	INFO("VTU file written.");
 
diff --git a/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp b/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
index cf3b58ae28e89c87c03d334e49711df5688048df..b2fd9a3f821176809357b4fc456f5303a670c97b 100644
--- a/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
+++ b/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
@@ -22,15 +22,16 @@
 #include "Applications/ApplicationsLib/LogogSetup.h"
 
 // FileIO
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
-#include "FileIO/readGeometryFromFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 // GeoLib
 #include "GeoLib/GEOObjects.h"
 #include "GeoLib/Polygon.h"
 #include "GeoLib/AnalyticalGeometry.h"
 
+#include "GeoLib/IO/readGeometryFromFile.h"
+
 // MathLib
 #include "MathLib/Vector3.h"
 #include "MathLib/LinAlg/Dense/DenseMatrix.h"
@@ -162,7 +163,7 @@ int main (int argc, char* argv[])
 
 	// *** read geometry
 	GeoLib::GEOObjects geometries;
-	FileIO::readGeometryFromFile(geometry_fname.getValue(), geometries);
+	GeoLib::IO::readGeometryFromFile(geometry_fname.getValue(), geometries);
 
 	std::string geo_name;
 	{
@@ -201,7 +202,7 @@ int main (int argc, char* argv[])
 	GeoLib::Polygon polygon(*(ply));
 
 	// *** read mesh
-	MeshLib::Mesh * mesh(FileIO::readMeshFromFile(mesh_in.getValue()));
+	MeshLib::Mesh * mesh(MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	std::vector<std::string> property_names(
 		mesh->getProperties().getPropertyVectorNames());
 	INFO("Mesh contains %d property vectors:", property_names.size());
@@ -248,7 +249,7 @@ int main (int argc, char* argv[])
 		resetMeshElementProperty(*mesh, polygon, property_name, bool_property_val);
 	}
 
-	FileIO::writeMeshToFile(*mesh, mesh_out.getValue());
+	MeshLib::IO::writeMeshToFile(*mesh, mesh_out.getValue());
 
 	return EXIT_SUCCESS;
 }
diff --git a/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp b/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp
index 67d3b000c54a4b52f54c12b1da79d32550b94c9f..28ae467f359639d89616269c91aaad4f81e72cbb 100644
--- a/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp
+++ b/Applications/Utils/MeshEdit/appendLinesAlongPolyline.cpp
@@ -21,9 +21,9 @@
 #include "PolylineVec.h"
 
 // FileIO
-#include "Legacy/MeshIO.h"
-#include "readMeshFromFile.h"
-#include "XmlIO/Boost/BoostXmlGmlInterface.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h"
 
 // MeshLib
 #include "Mesh.h"
@@ -57,7 +57,7 @@ int main (int argc, char* argv[])
 
 	// read GEO objects
 	GeoLib::GEOObjects geo_objs;
-	FileIO::BoostXmlGmlInterface xml(geo_objs);
+	GeoLib::IO::BoostXmlGmlInterface xml(geo_objs);
 	xml.readFile(geoFileArg.getValue());
 
 	std::vector<std::string> geo_names;
@@ -75,7 +75,7 @@ int main (int argc, char* argv[])
 	}
 
 	// read a mesh
-	MeshLib::Mesh const*const mesh (FileIO::readMeshFromFile(mesh_in.getValue()));
+	MeshLib::Mesh const*const mesh (MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	if (!mesh)
 	{
 		ERR("Mesh file %s not found", mesh_in.getValue().c_str());
@@ -89,7 +89,7 @@ int main (int argc, char* argv[])
 	INFO("Mesh created: %d nodes, %d elements.", new_mesh->getNNodes(), new_mesh->getNElements());
 
 	// write into a file
-	FileIO::Legacy::MeshIO meshIO;
+	MeshLib::IO::Legacy::MeshIO meshIO;
 	meshIO.setMesh(new_mesh.get());
 	meshIO.writeToFile(mesh_out.getValue());
 
diff --git a/Applications/Utils/MeshEdit/checkMesh.cpp b/Applications/Utils/MeshEdit/checkMesh.cpp
index dffe85af3beb457e2dbf27361179e2896fdbffb6..3ea4a976220442afa7c5bb9d471ab68f41e6d583 100644
--- a/Applications/Utils/MeshEdit/checkMesh.cpp
+++ b/Applications/Utils/MeshEdit/checkMesh.cpp
@@ -27,8 +27,8 @@
 #include "MeshLib/MeshInformation.h"
 #include "MeshLib/MeshQuality/MeshValidation.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/Legacy/MeshIO.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
 
 int main(int argc, char *argv[])
 {
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
 	const unsigned long mem_without_mesh (mem_watch.getVirtMemUsage());
 	BaseLib::RunTime run_time;
 	run_time.start();
-	const MeshLib::Mesh* mesh = FileIO::readMeshFromFile(filename); // FileIO outputs nr. of nodes and elements
+	const MeshLib::Mesh* mesh = MeshLib::IO::readMeshFromFile(filename); // FileIO outputs nr. of nodes and elements
 	if (!mesh)
 		return 1;
 
diff --git a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp
index a2d40078ea8aeff10095910c31af8ce04e2608b0..a1fe56fbc82eea71d9666592624e27c250a2694a 100644
--- a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp
+++ b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp
@@ -22,9 +22,9 @@
 
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/AsciiRasterInterface.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "GeoLib/IO/AsciiRasterInterface.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 #include "MeshLib/Mesh.h"
 #include "MeshLib/MeshGenerators/MeshLayerMapper.h"
@@ -98,7 +98,7 @@ int main (int argc, char* argv[])
 	}
 
 	INFO("Reading mesh \"%s\" ... ", mesh_arg.getValue().c_str());
-	std::unique_ptr<MeshLib::Mesh> const sfc_mesh (FileIO::readMeshFromFile(mesh_arg.getValue()));
+	std::unique_ptr<MeshLib::Mesh> const sfc_mesh (MeshLib::IO::readMeshFromFile(mesh_arg.getValue()));
 	if (!sfc_mesh) {
 		ERR("Error reading mesh \"%s\".", mesh_arg.getValue().c_str());
 		return EXIT_FAILURE;
@@ -114,7 +114,7 @@ int main (int argc, char* argv[])
 		return EXIT_FAILURE;
 
 	MeshLib::MeshLayerMapper mapper;
-	if (auto rasters = FileIO::readRasters(raster_paths))
+	if (auto rasters = GeoLib::IO::readRasters(raster_paths))
 	{
 		if (!mapper.createLayers(*sfc_mesh, *rasters, min_thickness))
 			return EXIT_FAILURE;
@@ -126,7 +126,7 @@ int main (int argc, char* argv[])
 	if (!BaseLib::hasFileExtension("vtu", output_name))
 		output_name.append(".vtu");
 	INFO("Writing mesh \"%s\" ... ", output_name.c_str());
-	FileIO::writeMeshToFile(*(mapper.getMesh("SubsurfaceMesh").release()), output_name);
+	MeshLib::IO::writeMeshToFile(*(mapper.getMesh("SubsurfaceMesh").release()), output_name);
 	INFO("done.");
 
 	return EXIT_SUCCESS;
diff --git a/Applications/Utils/MeshEdit/editMaterialID.cpp b/Applications/Utils/MeshEdit/editMaterialID.cpp
index 1d3e2b81945a7ca36dbf49309df70cbc3a9a77d7..2ee57872e9b56b63c88db817698ad06478ec67e7 100644
--- a/Applications/Utils/MeshEdit/editMaterialID.cpp
+++ b/Applications/Utils/MeshEdit/editMaterialID.cpp
@@ -16,9 +16,9 @@
 #include "BaseLib/LogogSimpleFormatter.h"
 
 // FileIO
-#include "FileIO/Legacy/MeshIO.h"
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 // MeshLib
 #include "MeshLib/Mesh.h"
@@ -81,7 +81,7 @@ int main (int argc, char* argv[])
 		}
 	}
 
-	MeshLib::Mesh* mesh (FileIO::readMeshFromFile(mesh_in.getValue()));
+	MeshLib::Mesh* mesh (MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements());
 
 	if (condenseArg.isSet()) {
@@ -105,7 +105,7 @@ int main (int argc, char* argv[])
 	}
 
 	// write into a file
-	FileIO::writeMeshToFile(*mesh, mesh_out.getValue());
+	MeshLib::IO::writeMeshToFile(*mesh, mesh_out.getValue());
 
 	delete custom_format;
 	delete logog_cout;
diff --git a/Applications/Utils/MeshEdit/moveMeshNodes.cpp b/Applications/Utils/MeshEdit/moveMeshNodes.cpp
index 4cdf5919793def9cab51e30f61b14d810d867962..5613c653b3d7371bed2d7575040e19f815f1ced8 100644
--- a/Applications/Utils/MeshEdit/moveMeshNodes.cpp
+++ b/Applications/Utils/MeshEdit/moveMeshNodes.cpp
@@ -5,8 +5,8 @@
 
 #include "logog/include/logog.hpp"
 #include "LogogSimpleFormatter.h"
-#include "readMeshFromFile.h"
-#include "Legacy/MeshIO.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
 #include "AABB.h"
 #include "Mesh.h"
 #include "MeshLib/Node.h"
@@ -97,7 +97,7 @@ int main (int argc, char* argv[])
 		return -1;
 	}
 
-	MeshLib::Mesh* mesh (FileIO::readMeshFromFile(msh_name));
+	MeshLib::Mesh* mesh (MeshLib::IO::readMeshFromFile(msh_name));
 	//std::vector<std::size_t> del_nodes;
 
 	// Start keyword-specific selection of nodes
@@ -136,7 +136,7 @@ int main (int argc, char* argv[])
 		//const std::string value("D:\\Rappbodevorsperre_elevation440m.msh");
 		//double max_dist (25.0);	// squared maximum distance at which reference points are used
 		double offset (0.0); // additional offset for elevation (should be 0)
-		MeshLib::Mesh* ground_truth (FileIO::readMeshFromFile(value));
+		MeshLib::Mesh* ground_truth (MeshLib::IO::readMeshFromFile(value));
 		const std::vector<MeshLib::Node*> ground_truth_nodes (ground_truth->getNodes());
 		GeoLib::AABB bounding_box(ground_truth_nodes.begin(), ground_truth_nodes.end());
 		MathLib::Point3d const& min(bounding_box.getMinPoint());
@@ -183,7 +183,7 @@ int main (int argc, char* argv[])
 	}
 	/**** add other keywords here ****/
 
-	FileIO::Legacy::MeshIO meshIO;
+	MeshLib::IO::Legacy::MeshIO meshIO;
 	meshIO.setMesh(mesh);
 	meshIO.setPrecision(9);
 	meshIO.writeToFile(msh_name.substr(0, msh_name.length()-4) + "_new.msh");
diff --git a/Applications/Utils/MeshEdit/queryMesh.cpp b/Applications/Utils/MeshEdit/queryMesh.cpp
index 9db2929a8563e370d0937426728ad8f204f85dc4..3ee7f9e2f467d9ff08e780e6b05142a344d7a88f 100644
--- a/Applications/Utils/MeshEdit/queryMesh.cpp
+++ b/Applications/Utils/MeshEdit/queryMesh.cpp
@@ -23,7 +23,7 @@
 #include "MeshLib/Elements/Element.h"
 #include "MeshLib/Mesh.h"
 
-#include "FileIO/readMeshFromFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 
 int main(int argc, char *argv[])
 {
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
 
 	// read the mesh file
 	auto const mesh = std::unique_ptr<MeshLib::Mesh>(
-		FileIO::readMeshFromFile(filename));
+		MeshLib::IO::readMeshFromFile(filename));
 	if (!mesh)
 		return EXIT_FAILURE;
 
diff --git a/Applications/Utils/MeshEdit/removeMeshElements.cpp b/Applications/Utils/MeshEdit/removeMeshElements.cpp
index 0b47d87f5feeaaa47bda2de7d7d110e8df6b81c0..4a81ec112c28dd8fd9a0f894fdde450ca6075889 100644
--- a/Applications/Utils/MeshEdit/removeMeshElements.cpp
+++ b/Applications/Utils/MeshEdit/removeMeshElements.cpp
@@ -18,8 +18,8 @@
 
 #include "Applications/ApplicationsLib/LogogSetup.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 #include "MeshLib/Mesh.h"
 #include "MeshLib/Node.h"
@@ -99,7 +99,7 @@ int main (int argc, char* argv[])
 	cmd.parse(argc, argv);
 
 	std::unique_ptr<MeshLib::Mesh const> mesh(
-	    FileIO::readMeshFromFile(mesh_in.getValue()));
+	    MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements());
 	MeshLib::ElementSearch searcher(*mesh);
 
@@ -164,7 +164,7 @@ int main (int argc, char* argv[])
 		return EXIT_FAILURE;
 
 	// write into a file
-	FileIO::writeMeshToFile(*new_mesh, mesh_out.getValue());
+	MeshLib::IO::writeMeshToFile(*new_mesh, mesh_out.getValue());
 
 	return EXIT_SUCCESS;
 }
diff --git a/Applications/Utils/MeshEdit/reviseMesh.cpp b/Applications/Utils/MeshEdit/reviseMesh.cpp
index 2223573e53ae50d18f372301442c9d85e6388c6e..3666a58e07a11fe0fd8817bcf64b5e33519b8206 100644
--- a/Applications/Utils/MeshEdit/reviseMesh.cpp
+++ b/Applications/Utils/MeshEdit/reviseMesh.cpp
@@ -23,8 +23,8 @@
 #include "MeshLib/Mesh.h"
 #include "MeshLib/MeshEditing/MeshRevision.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 int main(int argc, char *argv[])
 {
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
 	cmd.parse( argc, argv );
 
 	// read a mesh file
-	MeshLib::Mesh* org_mesh (FileIO::readMeshFromFile(input_arg.getValue()));
+	MeshLib::Mesh* org_mesh (MeshLib::IO::readMeshFromFile(input_arg.getValue()));
 	if (!org_mesh)
 		return 0;
 	INFO("Mesh read: %d nodes, %d elements.", org_mesh->getNNodes(), org_mesh->getNElements());
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
 	// write into a file
 	if (new_mesh) {
 		INFO("Revised mesh: %d nodes, %d elements.", new_mesh->getNNodes(), new_mesh->getNElements());
-		FileIO::writeMeshToFile(*new_mesh, output_arg.getValue());
+		MeshLib::IO::writeMeshToFile(*new_mesh, output_arg.getValue());
 	}
 
 	delete org_mesh;
diff --git a/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp b/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp
index 3205b2ed79739d80d9dcf1bccb6e6bed7a971f49..8c022d63e1155cb6b3296913795b27a2a31b21f0 100644
--- a/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp
+++ b/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp
@@ -21,11 +21,11 @@
 #include "BaseLib/StringTools.h"
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/readGeometryFromFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 
 #include "GeoLib/GEOObjects.h"
 #include "GeoLib/Polygon.h"
+#include "GeoLib/IO/readGeometryFromFile.h"
 
 #include "MathLib/Vector3.h"
 
@@ -87,11 +87,11 @@ int main (int argc, char* argv[])
 
 	cmd.parse(argc, argv);
 
-	std::unique_ptr<MeshLib::Mesh const> mesh(FileIO::readMeshFromFile(mesh_in.getValue()));
+	std::unique_ptr<MeshLib::Mesh const> mesh(MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	INFO("Mesh read: %u nodes, %u elements.", mesh->getNNodes(), mesh->getNElements());
 
 	GeoLib::GEOObjects geo_objs;
-	FileIO::readGeometryFromFile(geo_in.getValue(), geo_objs);
+	GeoLib::IO::readGeometryFromFile(geo_in.getValue(), geo_objs);
 	std::vector<std::string> geo_names;
 	geo_objs.getGeometryNames(geo_names);
 	INFO("Geometry \"%s\" read: %u points, %u polylines.",
diff --git a/Applications/Utils/ModelPreparation/CMakeLists.txt b/Applications/Utils/ModelPreparation/CMakeLists.txt
index 8475b547d35f9992c51ddb7d93145d87cf133be3..8abcefe611c6021371a95ef797c28ce6b4454b70 100644
--- a/Applications/Utils/ModelPreparation/CMakeLists.txt
+++ b/Applications/Utils/ModelPreparation/CMakeLists.txt
@@ -1,9 +1,7 @@
 add_executable(ComputeNodeAreasFromSurfaceMesh ComputeNodeAreasFromSurfaceMesh.cpp)
 set_target_properties(ComputeNodeAreasFromSurfaceMesh PROPERTIES FOLDER Utilities)
 target_link_libraries(ComputeNodeAreasFromSurfaceMesh
-	FileIO
 	MeshLib
-	MathLib
 	${OGS_VTK_REQUIRED_LIBS}
 )
 
diff --git a/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp b/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp
index 60d671db54f2484bf16061a2b6846cdf27991a4a..0d2725d0b4a55978c6e2ce6a7f7d31b3e7d9b49d 100644
--- a/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp
+++ b/Applications/Utils/ModelPreparation/ComputeNodeAreasFromSurfaceMesh.cpp
@@ -20,8 +20,7 @@
 
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/readGeometryFromFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 
 #include "MeshLib/Mesh.h"
 #include "MeshLib/Node.h"
@@ -79,7 +78,7 @@ int main (int argc, char* argv[])
 	cmd.parse(argc, argv);
 
 	std::unique_ptr<MeshLib::Mesh> surface_mesh(
-	    FileIO::readMeshFromFile(mesh_in.getValue()));
+	    MeshLib::IO::readMeshFromFile(mesh_in.getValue()));
 	INFO("Mesh read: %u nodes, %u elements.", surface_mesh->getNNodes(),
 	     surface_mesh->getNElements());
 	// ToDo check if mesh is read correct and if the mesh is a surface mesh
diff --git a/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp b/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp
index 5033281e63e1355e2caf7719c390c5ebcf63151d..16bdb49ada6e7f44d19cb7ce0f7be8d6f7099675 100644
--- a/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp
+++ b/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp
@@ -27,12 +27,11 @@
 
 // geometry
 #include "GEOObjects.h"
-#include "Legacy/OGSIOVer4.h"
-#include "XmlIO/Qt/XmlGmlInterface.h"
+#include "GeoLib/IO/Legacy/OGSIOVer4.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
 
-// mesh
-#include "Legacy/MeshIO.h"
-#include "FileIO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 OGSFileConverter::OGSFileConverter(QWidget* parent)
 	: QDialog(parent)
@@ -50,7 +49,7 @@ void OGSFileConverter::convertGML2GLI(const QStringList &input, const QString &o
 		return;
 
 	GeoLib::GEOObjects geo_objects;
-	FileIO::XmlGmlInterface xml(geo_objects);
+	GeoLib::IO::XmlGmlInterface xml(geo_objects);
 
 	for (QStringList::const_iterator it=input.begin(); it!=input.end(); ++it)
 	{
@@ -67,7 +66,7 @@ void OGSFileConverter::convertGML2GLI(const QStringList &input, const QString &o
 		}
 		std::vector<std::string> geo_names;
 		geo_objects.getGeometryNames(geo_names);
-		FileIO::Legacy::writeGLIFileV4(output_str, geo_names[0], geo_objects);
+		GeoLib::IO::Legacy::writeGLIFileV4(output_str, geo_names[0], geo_objects);
 		geo_objects.removeSurfaceVec(geo_names[0]);
 		geo_objects.removePolylineVec(geo_names[0]);
 		geo_objects.removePointVec(geo_names[0]);
@@ -81,7 +80,7 @@ void OGSFileConverter::convertGLI2GML(const QStringList &input, const QString &o
 		return;
 
 	GeoLib::GEOObjects geo_objects;
-	FileIO::XmlGmlInterface xml(geo_objects);
+	GeoLib::IO::XmlGmlInterface xml(geo_objects);
 
 	for (QStringList::const_iterator it=input.begin(); it!=input.end(); ++it)
 	{
@@ -94,7 +93,7 @@ void OGSFileConverter::convertGLI2GML(const QStringList &input, const QString &o
 		std::string unique_name;
 		std::vector<std::string> errors;
 
-		FileIO::Legacy::readGLIFileV4(it->toStdString(), geo_objects, unique_name, errors);
+		GeoLib::IO::Legacy::readGLIFileV4(it->toStdString(), geo_objects, unique_name, errors);
 		if (errors.empty() || (errors.size()==1 && errors[0].compare("[readSurface] polyline for surface not found!")==0))
 		{
 			std::string const geo_name = BaseLib::extractBaseName(it->toStdString());
@@ -124,13 +123,13 @@ void OGSFileConverter::convertVTU2MSH(const QStringList &input, const QString &o
 		if (fileExists(output_str))
 			continue;
 
-		MeshLib::Mesh const*const mesh (FileIO::VtuInterface::readVTUFile(it->toStdString().c_str()));
+		MeshLib::Mesh const*const mesh (MeshLib::IO::VtuInterface::readVTUFile(it->toStdString().c_str()));
 		if (mesh == nullptr)
 		{
 			OGSError::box("Error reading mesh " + fi.fileName());
 			continue;
 		}
-		FileIO::Legacy::MeshIO meshIO;
+		MeshLib::IO::Legacy::MeshIO meshIO;
 		meshIO.setMesh(mesh);
 		meshIO.writeToFile(output_str.c_str());
 		delete mesh;
@@ -151,14 +150,14 @@ void OGSFileConverter::convertMSH2VTU(const QStringList &input, const QString &o
 		if (fileExists(output_str))
 			continue;
 
-		FileIO::Legacy::MeshIO meshIO;
+		MeshLib::IO::Legacy::MeshIO meshIO;
 		MeshLib::Mesh const*const mesh (meshIO.loadMeshFromFile(it->toStdString()));
 		if (mesh == nullptr)
 		{
 			OGSError::box("Error reading mesh " + fi.fileName());
 			continue;
 		}
-		FileIO::VtuInterface vtu(mesh);
+		MeshLib::IO::VtuInterface vtu(mesh);
 		vtu.writeToFile(output_str);
 		delete mesh;
 	}
diff --git a/Applications/Utils/SimpleMeshCreation/CMakeLists.txt b/Applications/Utils/SimpleMeshCreation/CMakeLists.txt
index 48014d88540c8a0369ec2300481704c6a820bd22..29c11e6717385acc7621723a24c99e9fa821d13a 100644
--- a/Applications/Utils/SimpleMeshCreation/CMakeLists.txt
+++ b/Applications/Utils/SimpleMeshCreation/CMakeLists.txt
@@ -2,7 +2,7 @@
 include_directories(
 	${CMAKE_SOURCE_DIR}/BaseLib
 	${CMAKE_SOURCE_DIR}/FileIO
-	${CMAKE_SOURCE_DIR}/FileIO/Legacy
+	${CMAKE_SOURCE_DIR}/MeshLib/IO/Legacy
 	${CMAKE_SOURCE_DIR}/GeoLib
 	${CMAKE_SOURCE_DIR}/MathLib
 	${CMAKE_SOURCE_DIR}/MeshLib
@@ -12,13 +12,13 @@ include_directories(
 if(OGS_BUILD_GUI)
 	add_executable(createMeshElemPropertiesFromASCRaster createMeshElemPropertiesFromASCRaster.cpp)
 	set_target_properties(createMeshElemPropertiesFromASCRaster PROPERTIES FOLDER Utilities)
-	target_link_libraries(createMeshElemPropertiesFromASCRaster FileIO)
+	target_link_libraries(createMeshElemPropertiesFromASCRaster MeshLib)
 	ADD_VTK_DEPENDENCY(createMeshElemPropertiesFromASCRaster)
 endif() # OGS_BUILD_GUI (VtkVis-target is existing)
 
 
 add_executable(generateStructuredMesh generateStructuredMesh.cpp)
-target_link_libraries(generateStructuredMesh FileIO)
+target_link_libraries(generateStructuredMesh MeshLib)
 set_target_properties(generateStructuredMesh PROPERTIES FOLDER Utilities)
 
 ####################
diff --git a/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp b/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp
index 5139ebbc5bbf3601eb48519fe50338c584b30bb8..c0c7f909614aae6b76380623fbfd6239701d3b3b 100644
--- a/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp
+++ b/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp
@@ -21,9 +21,9 @@
 #include "BaseLib/quicksort.h"
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
-#include "FileIO/writeMeshToFile.h"
-#include "FileIO/AsciiRasterInterface.h"
+#include "MeshLib/IO/readMeshFromFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
+#include "GeoLib/IO/AsciiRasterInterface.h"
 
 #include "GeoLib/Raster.h"
 
@@ -124,11 +124,11 @@ int main (int argc, char* argv[])
 	cmd.parse( argc, argv );
 
 	// read mesh
-	std::unique_ptr<MeshLib::Mesh> dest_mesh(FileIO::readMeshFromFile(mesh_arg.getValue()));
+	std::unique_ptr<MeshLib::Mesh> dest_mesh(MeshLib::IO::readMeshFromFile(mesh_arg.getValue()));
 
 	// read raster and if required manipulate it
 	auto raster = std::unique_ptr<GeoLib::Raster>(
-		FileIO::AsciiRasterInterface::getRasterFromASCFile(raster_arg.getValue()));
+		GeoLib::IO::AsciiRasterInterface::getRasterFromASCFile(raster_arg.getValue()));
 	GeoLib::RasterHeader header (raster->getHeader());
 	if (refinement_arg.getValue() > 1) {
 		raster->refineRaster(refinement_arg.getValue());
@@ -138,7 +138,7 @@ int main (int argc, char* argv[])
 			                                      raster_arg.getValue()));
 			new_raster_fname += "-" + std::to_string(header.n_rows) + "x" +
 			                    std::to_string(header.n_cols) + ".asc";
-			FileIO::AsciiRasterInterface::writeRasterAsASC(*raster, new_raster_fname);
+			GeoLib::IO::AsciiRasterInterface::writeRasterAsASC(*raster, new_raster_fname);
 		}
 	}
 
@@ -242,7 +242,7 @@ int main (int argc, char* argv[])
 			(*materialIds)[dest_mesh->getElement(dest_perm[k])->getID()] = k;
 		}
 
-		FileIO::writeMeshToFile(*dest_mesh, out_mesh_arg.getValue());
+		MeshLib::IO::writeMeshToFile(*dest_mesh, out_mesh_arg.getValue());
 	}
 
 	return 0;
diff --git a/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp b/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp
index 77f1d5123e5c76f11af6ec846f2340f8e38b7de8..d1fa6efe7c90c5b643fd5a7d2d7b2685280aea00 100644
--- a/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp
+++ b/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp
@@ -29,7 +29,7 @@
 #include "MeshLib/MeshEnums.h"
 #include "MeshLib/MeshGenerators/MeshGenerator.h"
 
-#include "FileIO/writeMeshToFile.h"
+#include "MeshLib/IO/writeMeshToFile.h"
 
 namespace
 {
@@ -220,7 +220,7 @@ int main (int argc, char* argv[])
 		INFO("Mesh created: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements());
 
 		// write into a file
-		FileIO::writeMeshToFile(*(mesh.get()), mesh_out.getValue());
+		MeshLib::IO::writeMeshToFile(*(mesh.get()), mesh_out.getValue());
 	}
 
 	return 0;
diff --git a/BaseLib/CMakeLists.txt b/BaseLib/CMakeLists.txt
index cd973a28f8a653809c100315625c2903044d5282..c1b597236010f8fd97e535d0574a5407806bd21d 100644
--- a/BaseLib/CMakeLists.txt
+++ b/BaseLib/CMakeLists.txt
@@ -1,4 +1,15 @@
 GET_SOURCE_FILES(SOURCES)
+GET_SOURCE_FILES(SOURCES_IO IO)
+
+set(SOURCES ${SOURCES} ${SOURCES_IO})
+
+GET_SOURCE_FILES(SOURCES_IO_BASE_XML IO/XmlIO)
+set(SOURCES ${SOURCES} ${SOURCES_IO_BASE_XML})
+
+if(QT4_FOUND)
+	GET_SOURCE_FILES(SOURCES_IO_QT_XML IO/XmlIO/Qt)
+	set(SOURCES ${SOURCES} ${SOURCES_IO_QT_XML})
+endif()
 
 list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.cpp" BuildInfo.h)
 
@@ -15,6 +26,13 @@ if(MSVC)
 	target_link_libraries(BaseLib WinMM) # needed for timeGetTime
 endif()
 
+if(QT4_FOUND)
+	target_link_libraries(BaseLib Qt4::QtXml Qt4::QtXmlPatterns)
+	if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND)
+		target_link_libraries(BaseLib Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32)
+	endif()
+endif()
+
 if(TARGET Eigen)
 	add_dependencies(BaseLib Eigen)
 endif()
diff --git a/FileIO/Writer.cpp b/BaseLib/IO/Writer.cpp
similarity index 94%
rename from FileIO/Writer.cpp
rename to BaseLib/IO/Writer.cpp
index 8b03518937b7c13d997948dbd0b86e84ef906aee..9ae1fe21c3b358003d1521834ece36e152675e55 100644
--- a/FileIO/Writer.cpp
+++ b/BaseLib/IO/Writer.cpp
@@ -19,7 +19,9 @@
 #include <fstream>
 #include <limits>
 
-namespace FileIO
+namespace BaseLib
+{
+namespace IO
 {
 
 Writer::Writer()
@@ -72,4 +74,5 @@ void Writer::setFormat(std::ios_base::fmtflags flags)
 	_out.setf(flags);
 }
 
-} // namespace FileIO
+} // namespace IO
+} // namespace BaseLib
diff --git a/FileIO/Writer.h b/BaseLib/IO/Writer.h
similarity index 95%
rename from FileIO/Writer.h
rename to BaseLib/IO/Writer.h
index 94a4538cc1d5a9b318150363886e90c2c2fcd1af..2a6652391205107a1b9a9fffea2d7dd02a2148d8 100644
--- a/FileIO/Writer.h
+++ b/BaseLib/IO/Writer.h
@@ -18,7 +18,9 @@
 #include <string>
 #include <sstream>
 
-namespace FileIO
+namespace BaseLib
+{
+namespace IO
 {
 
 /// @brief Base class which enables writing an object to string, stringstream
@@ -58,6 +60,7 @@ private:
 
 };
 
-} // namespace FileIO
+} // namespace IO
+} // namespace BaseLib
 
 #endif // WRITER_H
diff --git a/FileIO/XmlIO/Qt/XMLQtInterface.cpp b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp
similarity index 97%
rename from FileIO/XmlIO/Qt/XMLQtInterface.cpp
rename to BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp
index 93c72f3a9ae587acb0dd15180a11c093270ead05..57374b0d5bae558c7f74fc219782d832e4db5d38 100644
--- a/FileIO/XmlIO/Qt/XMLQtInterface.cpp
+++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp
@@ -24,7 +24,9 @@
 
 #include <logog/include/logog.hpp>
 
-namespace FileIO
+namespace BaseLib
+{
+namespace IO
 {
 
 XMLQtInterface::XMLQtInterface(const std::string &schemaFile) :
@@ -142,4 +144,5 @@ bool XMLQtInterface::isHashGood(const QByteArray &hash) const
 	return true;
 }
 
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace BaseLib
diff --git a/FileIO/XmlIO/Qt/XMLQtInterface.h b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h
similarity index 95%
rename from FileIO/XmlIO/Qt/XMLQtInterface.h
rename to BaseLib/IO/XmlIO/Qt/XMLQtInterface.h
index d325e73cdd5d2c814e5d7e0f655ad60b219502e7..fb52d5131a5b8a9d192f82b54e00b2522eaa9594 100644
--- a/FileIO/XmlIO/Qt/XMLQtInterface.h
+++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h
@@ -23,7 +23,9 @@ class QDomDocument;
 class QDomNode;
 class QDomElement;
 
-namespace FileIO
+namespace BaseLib
+{
+namespace IO
 {
 
 class XMLQtInterface
@@ -60,6 +62,7 @@ protected:
 	QString _fileName;
 };
 
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace BaseLib
 
 #endif /* XMLQTINTERFACE_H_ */
diff --git a/FileIO/XmlIO/XMLInterface.cpp b/BaseLib/IO/XmlIO/XMLInterface.cpp
similarity index 93%
rename from FileIO/XmlIO/XMLInterface.cpp
rename to BaseLib/IO/XmlIO/XMLInterface.cpp
index 58f3d88d6f16d7b9e61c7e38ab6040935f1e37e5..85f1d83fd09fb4083cc6e3d9ce42deec3b0f68c0 100644
--- a/FileIO/XmlIO/XMLInterface.cpp
+++ b/BaseLib/IO/XmlIO/XMLInterface.cpp
@@ -14,7 +14,9 @@
 
 #include "XMLInterface.h"
 
-namespace FileIO
+namespace BaseLib
+{
+namespace IO
 {
 
 XMLInterface::XMLInterface() :
@@ -22,3 +24,4 @@ XMLInterface::XMLInterface() :
 {}
 
 }
+}
diff --git a/FileIO/XmlIO/XMLInterface.h b/BaseLib/IO/XmlIO/XMLInterface.h
similarity index 87%
rename from FileIO/XmlIO/XMLInterface.h
rename to BaseLib/IO/XmlIO/XMLInterface.h
index 4531c6af868a52d75905cec38fd3164b28845897..fabd4f7fb6d9edfaf4f13ffb33dd15d0bd38338e 100644
--- a/FileIO/XmlIO/XMLInterface.h
+++ b/BaseLib/IO/XmlIO/XMLInterface.h
@@ -17,14 +17,16 @@
 
 #include <string>
 
-#include "FileIO/Writer.h"
+#include "BaseLib/IO/Writer.h"
 
-namespace FileIO
+namespace BaseLib
+{
+namespace IO
 {
 /**
  * \brief Base class for writing any information to and from XML files.
  */
-class XMLInterface : public Writer
+class XMLInterface : public BaseLib::IO::Writer
 {
 public:
 	XMLInterface();
@@ -37,6 +39,7 @@ protected:
 	std::string _exportName;
 };
 
+}
 }
 
 #endif // XMLINTERFACE_H
diff --git a/FileIO/CMakeLists.txt b/FileIO/CMakeLists.txt
index 969ed1ff3ad874108a5d9a947d56c8d6547adc60..0964978b5f879c65d9a42e021446d81c75c277f9 100644
--- a/FileIO/CMakeLists.txt
+++ b/FileIO/CMakeLists.txt
@@ -1,6 +1,4 @@
 set(SOURCES
-	AsciiRasterInterface.h
-	AsciiRasterInterface.cpp
 	CsvInterface.h
 	CsvInterface.cpp
 	GMSInterface.h
@@ -9,20 +7,8 @@ set(SOURCES
 	GMSHInterface.cpp
 	PetrelInterface.h
 	PetrelInterface.cpp
-	readGeometryFromFile.h
-	readGeometryFromFile.cpp
-	readMeshFromFile.h
-	readMeshFromFile.cpp
-	writeGeometryToFile.h
-	writeGeometryToFile.cpp
 	TetGenInterface.h
 	TetGenInterface.cpp
-	TINInterface.h
-	TINInterface.cpp
-	Writer.h
-	Writer.cpp
-	writeMeshToFile.h
-	writeMeshToFile.cpp
 )
 if(Shapelib_FOUND)
 	list(APPEND SOURCES SHPInterface.h SHPInterface.cpp)
@@ -44,30 +30,16 @@ if(QT4_FOUND)
 	set(SOURCES ${SOURCES} ${SOURCES_QT_XML})
 endif()
 
-# It could be used for other MPI based DDC approach in future.
-if(OGS_USE_PETSC)
-	GET_SOURCE_FILES(SOURCES_MPI_IO MPI_IO)
-	set(SOURCES ${SOURCES} ${SOURCES_MPI_IO})
-endif()
-
 include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake)
 
 # Create the library
 add_library(FileIO ${SOURCES})
+target_link_libraries(FileIO DataHolderLib)
 
-target_link_libraries(FileIO
-	GeoLib
-	MeshLib
-	InSituLib
-	logog
-)
 if(QT4_FOUND)
 	target_link_libraries(FileIO Qt4::QtXml Qt4::QtXmlPatterns)
-	if(WIN32 AND CMAKE_CROSSCOMPILING)
-		find_package(OpenSSL)
-		if(OPENSSL_FOUND)
-			target_link_libraries(FileIO Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32)
-		endif()
+	if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND)
+		target_link_libraries(FileIO Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32)
 	endif()
 endif()
 
diff --git a/FileIO/GMSHInterface.h b/FileIO/GMSHInterface.h
index 9ac706ff741ffe8b822f0a056ee9772e3b51a785..5971665cf1cfee1c3f94e5aa5f8520eb54a7f9bd 100644
--- a/FileIO/GMSHInterface.h
+++ b/FileIO/GMSHInterface.h
@@ -19,11 +19,10 @@
 #include <map>
 #include <string>
 
-// FileIO
-#include "Writer.h"
-#include "GmshIO/GMSHPoint.h"
-#include "GmshIO/GMSHPolygonTree.h"
-#include "GmshIO/GMSHMeshDensityStrategy.h"
+#include "BaseLib/IO/Writer.h"
+#include "FileIO/GmshIO/GMSHPoint.h"
+#include "FileIO/GmshIO/GMSHPolygonTree.h"
+#include "FileIO/GmshIO/GMSHMeshDensityStrategy.h"
 
 #include "MathLib/LinAlg/Dense/DenseMatrix.h"
 
@@ -55,7 +54,7 @@ enum class MeshDensityAlgorithm {
 /**
  * \brief Reads and writes GMSH-files to and from OGS data structures.
  */
-class GMSHInterface : public Writer
+class GMSHInterface : public BaseLib::IO::Writer
 {
 public:
 
diff --git a/FileIO/XmlIO/Qt/XmlGspInterface.cpp b/FileIO/XmlIO/Qt/XmlGspInterface.cpp
index ee51b8121a5b30f49618d8321c94fa4f5cfd72f9..483ecf990c0b1e2444d7c4ed8024ccce9e17c767 100644
--- a/FileIO/XmlIO/Qt/XmlGspInterface.cpp
+++ b/FileIO/XmlIO/Qt/XmlGspInterface.cpp
@@ -21,15 +21,15 @@
 
 #include "GeoLib/GEOObjects.h"
 
-#include "XmlGmlInterface.h"
-#include "XmlStnInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlStnInterface.h"
 
 #include "BaseLib/FileTools.h"
 #include "BaseLib/FileFinder.h"
+#include "BaseLib/IO/Writer.h"
 
-#include "FileIO/Writer.h"
-#include "FileIO/Legacy/MeshIO.h"
-#include "FileIO/readMeshFromFile.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 #include "MeshLib/Mesh.h"
 
 #include <QFile>
@@ -69,7 +69,7 @@ int XmlGspInterface::readFile(const QString &fileName)
 		const QString file_node(fileList.at(i).nodeName());
 		if (file_node.compare("geo") == 0)
 		{
-			XmlGmlInterface gml(_project.getGEOObjects());
+			GeoLib::IO::XmlGmlInterface gml(_project.getGEOObjects());
 			const QDomNodeList childList = fileList.at(i).childNodes();
 			for(int j = 0; j < childList.count(); j++)
 			{
@@ -86,7 +86,7 @@ int XmlGspInterface::readFile(const QString &fileName)
 		}
 		else if (file_node.compare("stn") == 0)
 		{
-			XmlStnInterface stn(_project.getGEOObjects());
+			GeoLib::IO::XmlStnInterface stn(_project.getGEOObjects());
 			const QDomNodeList childList = fileList.at(i).childNodes();
 			for(int j = 0; j < childList.count(); j++)
 				if (childList.at(j).nodeName().compare("file") == 0)
@@ -97,7 +97,8 @@ int XmlGspInterface::readFile(const QString &fileName)
 		{
 			const std::string msh_name = path.toStdString() +
 			                             fileList.at(i).toElement().text().toStdString();
-			std::unique_ptr<MeshLib::Mesh> mesh(FileIO::readMeshFromFile(msh_name));
+			std::unique_ptr<MeshLib::Mesh> mesh(
+			    MeshLib::IO::readMeshFromFile(msh_name));
 			if (mesh)
 				_project.addMesh(std::move(mesh));
 		}
@@ -109,7 +110,7 @@ int XmlGspInterface::readFile(const QString &fileName)
 int XmlGspInterface::writeToFile(const std::string& filename)
 {
 	_filename = filename;
-	return FileIO::Writer::writeToFile(filename);
+	return BaseLib::IO::Writer::writeToFile(filename);
 }
 
 bool XmlGspInterface::write()
@@ -136,7 +137,7 @@ bool XmlGspInterface::write()
 	for (std::vector<std::string>::const_iterator it(geoNames.begin()); it != geoNames.end(); ++it)
 	{
 		// write GLI file
-		XmlGmlInterface gml(geoObjects);
+		GeoLib::IO::XmlGmlInterface gml(geoObjects);
 		std::string name(*it);
 		gml.setNameForExport(name);
 		if (gml.writeToFile(std::string(path + name + ".gml")))
@@ -157,7 +158,7 @@ bool XmlGspInterface::write()
 	for (auto const& mesh : mesh_vector)
 	{
 		// write mesh file
-		Legacy::MeshIO meshIO;
+		MeshLib::IO::Legacy::MeshIO meshIO;
 		meshIO.setMesh((&mesh)->get());
 		std::string fileName(path + mesh->getName());
 		meshIO.writeToFile(fileName);
@@ -177,7 +178,7 @@ bool XmlGspInterface::write()
 	for (std::vector<std::string>::const_iterator it(stnNames.begin()); it != stnNames.end(); ++it)
 	{
 		// write STN file
-		XmlStnInterface stn(geoObjects);
+		GeoLib::IO::XmlStnInterface stn(geoObjects);
 		std::string name(*it);
 		stn.setNameForExport(name);
 
diff --git a/FileIO/XmlIO/Qt/XmlGspInterface.h b/FileIO/XmlIO/Qt/XmlGspInterface.h
index 02350cf9616de654aa7dd13591a9f837e0a83aab..e936c1ce2bea245c914791bce105b4bfda640daa 100644
--- a/FileIO/XmlIO/Qt/XmlGspInterface.h
+++ b/FileIO/XmlIO/Qt/XmlGspInterface.h
@@ -20,8 +20,8 @@
 
 #include <QString>
 
-#include "../XMLInterface.h"
-#include "XMLQtInterface.h"
+#include "BaseLib/IO/XmlIO/XMLInterface.h"
+#include "BaseLib/IO/XmlIO/Qt/XMLQtInterface.h"
 
 #include "DataHolderLib/Project.h"
 
@@ -31,7 +31,8 @@ namespace FileIO
 /**
  * \brief Reads and writes project information to and from XML files.
  */
-class XmlGspInterface : public XMLInterface, public XMLQtInterface
+class XmlGspInterface : public BaseLib::IO::XMLInterface,
+                        public BaseLib::IO::XMLQtInterface
 {
 public:
 	XmlGspInterface(DataHolderLib::Project &project);
@@ -54,6 +55,6 @@ private:
 	DataHolderLib::Project& _project;
 };
 
-}
+} // end namespace FileIO
 
 #endif // XMLGSPINTERFACE_H
diff --git a/FileIO/XmlIO/Qt/XmlNumInterface.h b/FileIO/XmlIO/Qt/XmlNumInterface.h
index de2f274f7e0d2716a03eb36043761c6e522f7ee2..00c093a7cc70354876cab26de0750fff161243ec 100644
--- a/FileIO/XmlIO/Qt/XmlNumInterface.h
+++ b/FileIO/XmlIO/Qt/XmlNumInterface.h
@@ -15,13 +15,13 @@
 #ifndef XMLNUMINTERFACE_H
 #define XMLNUMINTERFACE_H
 
-#include "../XMLInterface.h"
-#include "XMLQtInterface.h"
+#include "BaseLib/IO/XmlIO/XMLInterface.h"
+#include "BaseLib/IO/XmlIO/Qt/XMLQtInterface.h"
 
 namespace FileIO
 {
 
-class XmlNumInterface : public XMLInterface, public XMLQtInterface
+class XmlNumInterface : public BaseLib::IO::XMLInterface, public BaseLib::IO::XMLQtInterface
 {
 public:
 	XmlNumInterface();
diff --git a/GeoLib/CMakeLists.txt b/GeoLib/CMakeLists.txt
index e8d6573392045455c02081e3d4ca8f0313c38c7a..71b100412cad9da2632371c128b83d2aeb7dc218 100644
--- a/GeoLib/CMakeLists.txt
+++ b/GeoLib/CMakeLists.txt
@@ -1,16 +1,36 @@
 # Source files
 GET_SOURCE_FILES(SOURCES_GeoLib)
+set(SOURCES ${SOURCES_GeoLib})
+
+GET_SOURCE_FILES(SOURCES_IO IO)
+GET_SOURCE_FILES(SOURCES_IO_Legacy IO/Legacy)
+set(SOURCES ${SOURCES} ${SOURCES_IO} ${SOURCES_IO_Legacy})
+
+GET_SOURCE_FILES(SOURCES_IO_BASE_XML IO/XmlIO)
+GET_SOURCE_FILES(SOURCES_IO_BOOST_XML IO/XmlIO/Boost)
+set(SOURCES ${SOURCES} ${SOURCES_IO_BASE_XML} ${SOURCES_IO_BOOST_XML})
+
+if(QT4_FOUND)
+	GET_SOURCE_FILES(SOURCES_IO_QT_XML IO/XmlIO/Qt)
+	set(SOURCES ${SOURCES} ${SOURCES_IO_QT_XML})
+endif()
 
 # Create the library
-add_library(GeoLib STATIC ${SOURCES_GeoLib}
+add_library(GeoLib STATIC ${SOURCES}
 	${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/tetgen/predicates.cxx
 )
 
 target_link_libraries(GeoLib
-	BaseLib
 	MathLib
 )
 
+if(QT4_FOUND)
+	target_link_libraries(GeoLib Qt4::QtXml Qt4::QtXmlPatterns)
+	if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND)
+		target_link_libraries(GeoLib Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32)
+	endif()
+endif()
+
 if(TARGET Boost)
 	add_dependencies(GeoLib Boost)
 endif()
diff --git a/FileIO/AsciiRasterInterface.cpp b/GeoLib/IO/AsciiRasterInterface.cpp
similarity index 97%
rename from FileIO/AsciiRasterInterface.cpp
rename to GeoLib/IO/AsciiRasterInterface.cpp
index 0b601206d837988b380ec6711cc39bc3de263028..523c6863c7aff8da813bb9be3f03bd2d576027bf 100644
--- a/FileIO/AsciiRasterInterface.cpp
+++ b/GeoLib/IO/AsciiRasterInterface.cpp
@@ -21,7 +21,10 @@
 
 #include "GeoLib/Raster.h"
 
-namespace FileIO {
+namespace GeoLib
+{
+namespace IO
+{
 
 GeoLib::Raster* AsciiRasterInterface::readRaster(std::string const& fname)
 {
@@ -238,7 +241,8 @@ boost::optional<std::vector<GeoLib::Raster const*>> readRasters(
 	std::vector<GeoLib::Raster const*> rasters;
 	rasters.reserve(raster_paths.size());
 	for (auto const& path : raster_paths)
-		rasters.push_back(FileIO::AsciiRasterInterface::readRaster(path));
+		rasters.push_back(GeoLib::IO::AsciiRasterInterface::readRaster(path));
     return boost::make_optional(rasters);
 }
-}
+} // end namespace IO
+} // end namespace GeoLib
diff --git a/FileIO/AsciiRasterInterface.h b/GeoLib/IO/AsciiRasterInterface.h
similarity index 95%
rename from FileIO/AsciiRasterInterface.h
rename to GeoLib/IO/AsciiRasterInterface.h
index 0e46eebaf2611728cfbd2ec21b2c396811c00b18..3705826698535e4397934f20335f7cb52a965864 100644
--- a/FileIO/AsciiRasterInterface.h
+++ b/GeoLib/IO/AsciiRasterInterface.h
@@ -21,8 +21,10 @@
 
 #include "GeoLib/Raster.h"
 
-namespace FileIO {
-
+namespace GeoLib
+{
+namespace IO
+{
 /**
  * Interface for reading and writing a number of ASCII raster formats.
  * Currently supported are reading and writing of Esri asc-files and
@@ -56,6 +58,7 @@ private:
 /// otherwise the returned vector contains pointers to the read rasters.
 boost::optional<std::vector<GeoLib::Raster const*>> readRasters(
     std::vector<std::string> const& raster_paths);
-}
+} // end namespace IO
+} // end namespace GeoLib
 
 #endif /* ASCIIRASTERINTERFACE_H_ */
diff --git a/FileIO/Legacy/OGSIOVer4.cpp b/GeoLib/IO/Legacy/OGSIOVer4.cpp
similarity index 98%
rename from FileIO/Legacy/OGSIOVer4.cpp
rename to GeoLib/IO/Legacy/OGSIOVer4.cpp
index 927b4c00adbf994f35f0285973e51ee8c5627d75..bcdbbfb69d246ce0e0e3d69c85101fb84705767d 100644
--- a/FileIO/Legacy/OGSIOVer4.cpp
+++ b/GeoLib/IO/Legacy/OGSIOVer4.cpp
@@ -34,9 +34,11 @@
 #include "GeoLib/Surface.h"
 #include "GeoLib/Triangle.h"
 
-#include "FileIO/TINInterface.h"
+#include "GeoLib/IO/TINInterface.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 namespace Legacy {
 
@@ -309,7 +311,7 @@ std::string readSurface(std::istream &in,
 		{
 			in >> line; // read value (file name)
 			line = path + line;
-			sfc = TINInterface::readTIN(line, pnt_vec, &errors);
+			sfc = GeoLib::IO::TINInterface::readTIN(line, pnt_vec, &errors);
 		}
 		//....................................................................
 		if (line.find("$MAT_GROUP") != std::string::npos) // subkeyword found
@@ -366,7 +368,7 @@ std::string readSurface(std::istream &in,
             }
             else
             {
-            	WARN("readSurface(): cannot create surface %s from polyline %d since polyline is not closed.",  name.c_str(), ply_id);
+                WARN("readSurface(): cannot create surface %s from polyline %d since polyline is not closed.",  name.c_str(), ply_id);
             }
         }
     }
@@ -539,7 +541,7 @@ std::size_t writeTINSurfaces(std::ofstream &os, GeoLib::SurfaceVec const* sfcs_v
 		os << "\t\t" << sfc_name << "\n";
 		// create tin file
 		sfc_name = path + sfc_name;
-		TINInterface::writeSurfaceAsTIN(*(*sfcs)[k], sfc_name.c_str());
+		GeoLib::IO::TINInterface::writeSurfaceAsTIN(*(*sfcs)[k], sfc_name.c_str());
 		sfc_count++;
 	}
 	return sfc_count;
@@ -689,4 +691,5 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects
 }
 
 }
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace GeoLib
diff --git a/FileIO/Legacy/OGSIOVer4.h b/GeoLib/IO/Legacy/OGSIOVer4.h
similarity index 93%
rename from FileIO/Legacy/OGSIOVer4.h
rename to GeoLib/IO/Legacy/OGSIOVer4.h
index 21dc3b8b082c996e14bba9188032be724513417d..3f97d5bc657c2270ec6efc25f8f2dd81cf81f440 100644
--- a/FileIO/Legacy/OGSIOVer4.h
+++ b/GeoLib/IO/Legacy/OGSIOVer4.h
@@ -20,10 +20,9 @@
 
 namespace GeoLib
 {
-    class GEOObjects;
-}
+class GEOObjects;
 
-namespace FileIO
+namespace IO
 {
 namespace Legacy {
 
@@ -44,6 +43,7 @@ void writeGLIFileV4 (const std::string& fname,
 void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects& geo);
 
 }
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace GeoLib
 
 #endif /* OGSIOVER4_H_ */
diff --git a/FileIO/TINInterface.cpp b/GeoLib/IO/TINInterface.cpp
similarity index 98%
rename from FileIO/TINInterface.cpp
rename to GeoLib/IO/TINInterface.cpp
index 9d93d0fcae791de53eddab2bbdb365e28b680034..e47f94d296445574fdfff3af480905222389965e 100644
--- a/FileIO/TINInterface.cpp
+++ b/GeoLib/IO/TINInterface.cpp
@@ -20,7 +20,9 @@
 #include "GeoLib/Surface.h"
 #include "GeoLib/Triangle.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 
 GeoLib::Surface* TINInterface::readTIN(std::string const& fname,
@@ -139,5 +141,5 @@ void TINInterface::writeSurfaceAsTIN(GeoLib::Surface const& surface, std::string
 	}
 	os.close();
 }
-
+} // end namespace IO
 } // end namespace GeoLib
diff --git a/FileIO/TINInterface.h b/GeoLib/IO/TINInterface.h
similarity index 95%
rename from FileIO/TINInterface.h
rename to GeoLib/IO/TINInterface.h
index 41822205e13e70f9625d04007155f25c236f9940..a64d9740e6677aeb343fd2150e753a7f148a19a5 100644
--- a/FileIO/TINInterface.h
+++ b/GeoLib/IO/TINInterface.h
@@ -18,9 +18,8 @@
 namespace GeoLib
 {
 class Surface;
-}
 
-namespace FileIO
+namespace IO
 {
 
 /**
@@ -48,6 +47,7 @@ public:
 	static void writeSurfaceAsTIN(GeoLib::Surface const& surface, std::string const& file_name);
 };
 
-}
+} // end namespace IO
+} // end namespace GeoLib
 
 #endif /* TININTERFACE_H_ */
diff --git a/FileIO/XmlIO/Boost/BoostXmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.cpp
similarity index 99%
rename from FileIO/XmlIO/Boost/BoostXmlGmlInterface.cpp
rename to GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.cpp
index 77b43478962ce0e171730f92a741b4af46c4ff8b..8e6c4edf08426784b21f77bab1113d8b63a26cce 100644
--- a/FileIO/XmlIO/Boost/BoostXmlGmlInterface.cpp
+++ b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.cpp
@@ -26,7 +26,9 @@
 #include "GeoLib/Surface.h"
 #include "GeoLib/Triangle.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 
 BoostXmlGmlInterface::BoostXmlGmlInterface(GeoLib::GEOObjects& geo_objs) :
@@ -338,4 +340,5 @@ void BoostXmlGmlInterface::addPolylinesToPropertyTree(
 	}
 }
 
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace GeoLib
diff --git a/FileIO/XmlIO/Boost/BoostXmlGmlInterface.h b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h
similarity index 90%
rename from FileIO/XmlIO/Boost/BoostXmlGmlInterface.h
rename to GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h
index 4fe364ea88adb7f7607a10c2094581639c171b37..a7633c13307eb0af6292ccbbd3dff1ace981ab93 100644
--- a/FileIO/XmlIO/Boost/BoostXmlGmlInterface.h
+++ b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h
@@ -21,21 +21,19 @@
 
 
 #include "BaseLib/ConfigTree.h"
-#include "FileIO/XmlIO/XMLInterface.h"
+#include "BaseLib/IO/XmlIO/XMLInterface.h"
 
 namespace GeoLib
 {
-    class GEOObjects;
-    class Point;
-    class Polyline;
-    class Surface;
-}
+class GEOObjects;
+class Point;
+class Polyline;
+class Surface;
 
-
-namespace FileIO
+namespace IO
 {
 
-class BoostXmlGmlInterface : public XMLInterface
+class BoostXmlGmlInterface : public BaseLib::IO::XMLInterface
 {
 public:
 	BoostXmlGmlInterface(GeoLib::GEOObjects& geo_objs);
@@ -75,6 +73,7 @@ private:
 	GeoLib::GEOObjects &_geo_objects;
 };
 
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace GeoLib
 
 #endif /* BOOSTXMLGMLINTERFACE_H_ */
diff --git a/FileIO/XmlIO/Qt/XmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp
similarity index 99%
rename from FileIO/XmlIO/Qt/XmlGmlInterface.cpp
rename to GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp
index 12501bc8782f3803d1fa943ae2d45c5b565ce163..36e488caef86addc9fd0204e02a62dc0a8fa3224 100644
--- a/FileIO/XmlIO/Qt/XmlGmlInterface.cpp
+++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp
@@ -23,7 +23,9 @@
 #include "BaseLib/FileFinder.h"
 #include "GeoLib/Triangle.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 XmlGmlInterface::XmlGmlInterface(GeoLib::GEOObjects& geo_objs) :
 	XMLInterface(), XMLQtInterface(BaseLib::FileFinder().getPath("OpenGeoSysGLI.xsd")), _geo_objs(geo_objs)
@@ -404,4 +406,6 @@ bool XmlGmlInterface::write()
 
 	return true;
 }
+
+}
 }
diff --git a/FileIO/XmlIO/Qt/XmlGmlInterface.h b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h
similarity index 90%
rename from FileIO/XmlIO/Qt/XmlGmlInterface.h
rename to GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h
index 6235fd4c7a32e0b722296b2307e160d4568ae08e..7c695ba277856cdfeb687a9ee344c1b6b8c1690a 100644
--- a/FileIO/XmlIO/Qt/XmlGmlInterface.h
+++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h
@@ -17,18 +17,21 @@
 
 #include <QString>
 
-#include "../XMLInterface.h"
-#include "XMLQtInterface.h"
+#include "BaseLib/IO/XmlIO/XMLInterface.h"
+#include "BaseLib/IO/XmlIO/Qt/XMLQtInterface.h"
 
 #include "GeoLib/GEOObjects.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 
 /**
  * \brief Reads and writes GeoObjects to and from XML files.
  */
-class XmlGmlInterface : public XMLInterface, public XMLQtInterface
+class XmlGmlInterface : public BaseLib::IO::XMLInterface,
+                        public BaseLib::IO::XMLQtInterface
 {
 public:
 	XmlGmlInterface(GeoLib::GEOObjects& geo_objs);
@@ -85,6 +88,7 @@ private:
 	std::map<std::size_t, std::size_t> _idx_map;
 };
 
-}
+} // end namespace IO
+} // end namespace BaseLib
 
 #endif // XMLGMLINTERFACE_H
diff --git a/FileIO/XmlIO/Qt/XmlStnInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
similarity index 99%
rename from FileIO/XmlIO/Qt/XmlStnInterface.cpp
rename to GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
index 416f9d2680140db78a48ddd1dabdff9901becdbd..4835acc84d6164e24f874b6bfa2f78145e943d20 100644
--- a/FileIO/XmlIO/Qt/XmlStnInterface.cpp
+++ b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
@@ -28,7 +28,9 @@
 #include "GeoLib/StationBorehole.h"
 #include "GeoLib/GEOObjects.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 XmlStnInterface::XmlStnInterface(GeoLib::GEOObjects& geo_objs) :
 	XMLInterface(), XMLQtInterface(BaseLib::FileFinder().getPath("OpenGeoSysSTN.xsd")), _geo_objs(geo_objs)
@@ -475,4 +477,6 @@ void XmlStnInterface::rapidReadStratigraphy( const rapidxml::xml_node<>* strat_r
 			WARN("XmlStnInterface::rapidReadStratigraphy(): Attribute missing in <horizon> tag.");
 	}
 }
-}
+
+} // end namespace IO
+} // end namespace GeoLib
diff --git a/FileIO/XmlIO/Qt/XmlStnInterface.h b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.h
similarity index 87%
rename from FileIO/XmlIO/Qt/XmlStnInterface.h
rename to GeoLib/IO/XmlIO/Qt/XmlStnInterface.h
index e5e9c042530e093cf7fe664557594047796bebb2..7bce4df6a95a5c71ed850711eb1bb39b9811872e 100644
--- a/FileIO/XmlIO/Qt/XmlStnInterface.h
+++ b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.h
@@ -19,22 +19,22 @@
 
 #include "RapidXML/rapidxml.hpp"
 
-#include "../XMLInterface.h"
-#include "XMLQtInterface.h"
+#include "BaseLib/IO/XmlIO/XMLInterface.h"
+#include "BaseLib/IO/XmlIO/Qt/XMLQtInterface.h"
 
 namespace GeoLib {
-	class GEOObjects;
-	class Point;
-	class StationBorehole;
-}
+class GEOObjects;
+class Point;
+class StationBorehole;
 
-namespace FileIO
+namespace IO
 {
 
 /**
  * \brief Reads and writes Observation Sites to and from XML files.
  */
-class XmlStnInterface : public XMLInterface, public XMLQtInterface
+class XmlStnInterface : public BaseLib::IO::XMLInterface,
+                        public BaseLib::IO::XMLQtInterface
 {
 public:
 	XmlStnInterface(GeoLib::GEOObjects& geo_objs);
@@ -71,6 +71,7 @@ private:
 	GeoLib::GEOObjects& _geo_objs;
 };
 
-}
+} // end namespace IO
+} // end namespace GeoLib
 
 #endif // XMLSTNINTERFACE_H
diff --git a/FileIO/readGeometryFromFile.cpp b/GeoLib/IO/readGeometryFromFile.cpp
similarity index 73%
rename from FileIO/readGeometryFromFile.cpp
rename to GeoLib/IO/readGeometryFromFile.cpp
index 3a84b33fa553fdd26a7bc9a019fc4c4e5370f131..5cfb82b0c9dbd44d63111022786ca6d10eedde5e 100644
--- a/FileIO/readGeometryFromFile.cpp
+++ b/GeoLib/IO/readGeometryFromFile.cpp
@@ -14,23 +14,26 @@
 
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
-#include "FileIO/Legacy/OGSIOVer4.h"
+#include "GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h"
+#include "GeoLib/IO/Legacy/OGSIOVer4.h"
 
 #include "GeoLib/GEOObjects.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 void
 readGeometryFromFile(std::string const& fname, GeoLib::GEOObjects & geo_objs)
 {
 	if (BaseLib::getFileExtension(fname).compare("gml") == 0) {
-		FileIO::BoostXmlGmlInterface xml(geo_objs);
+		GeoLib::IO::BoostXmlGmlInterface xml(geo_objs);
 		xml.readFile(fname);
 	} else {
 		std::vector<std::string> errors;
 		std::string geo_name(BaseLib::extractBaseNameWithoutExtension(fname));
-		FileIO::Legacy::readGLIFileV4(fname, geo_objs, geo_name, errors);
+		GeoLib::IO::Legacy::readGLIFileV4(fname, geo_objs, geo_name, errors);
 	}
 }
 }
+}
diff --git a/FileIO/readGeometryFromFile.h b/GeoLib/IO/readGeometryFromFile.h
similarity index 93%
rename from FileIO/readGeometryFromFile.h
rename to GeoLib/IO/readGeometryFromFile.h
index e546528867307f941ec649acaa3324d4cf915580..fe0156a04676a96f03534d48b3d499a547f9ae6b 100644
--- a/FileIO/readGeometryFromFile.h
+++ b/GeoLib/IO/readGeometryFromFile.h
@@ -18,10 +18,13 @@ namespace GeoLib
 	class GEOObjects;
 }
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 	void
 	readGeometryFromFile(std::string const& fname, GeoLib::GEOObjects & geo_objs);
 }
+}
 
 #endif // READGEOMETRYFROMFILE_H
diff --git a/FileIO/writeGeometryToFile.cpp b/GeoLib/IO/writeGeometryToFile.cpp
similarity index 77%
rename from FileIO/writeGeometryToFile.cpp
rename to GeoLib/IO/writeGeometryToFile.cpp
index 758cbf7600994b5fc58e11d222415ee7e551a516..518bcea09033dd1865adedf106e31116db441914 100644
--- a/FileIO/writeGeometryToFile.cpp
+++ b/GeoLib/IO/writeGeometryToFile.cpp
@@ -12,26 +12,29 @@
 
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
-#include "FileIO/Legacy/OGSIOVer4.h"
+#include "GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h"
+#include "GeoLib/IO/Legacy/OGSIOVer4.h"
 
 #include "GeoLib/GEOObjects.h"
 
-namespace FileIO
+namespace GeoLib
+{
+namespace IO
 {
 void writeGeometryToFile(std::string const& geo_name,
 	GeoLib::GEOObjects& geo_objs, std::string const& fname)
 {
 	std::string const extension(BaseLib::getFileExtension(fname));
 	if (extension == "gml" || extension == "GML") {
-		FileIO::BoostXmlGmlInterface xml(geo_objs);
+		GeoLib::IO::BoostXmlGmlInterface xml(geo_objs);
 		xml.setNameForExport(geo_name);
 		xml.writeToFile(fname);
 	} else if (extension == "gli" || extension == "GLI") {
-		FileIO::Legacy::writeGLIFileV4(fname, geo_name, geo_objs);
+		GeoLib::IO::Legacy::writeGLIFileV4(fname, geo_name, geo_objs);
 	} else {
 		ERR("Writing of geometry failed, since it was not possible to determine"
 			" the required format from file extension.");
 	}
 }
 }
+}
diff --git a/FileIO/writeGeometryToFile.h b/GeoLib/IO/writeGeometryToFile.h
similarity index 95%
rename from FileIO/writeGeometryToFile.h
rename to GeoLib/IO/writeGeometryToFile.h
index af8be4f18333f3003ac4d72969a59f0932740e38..19459e57174509f7b017984d15cf91f50707f603 100644
--- a/FileIO/writeGeometryToFile.h
+++ b/GeoLib/IO/writeGeometryToFile.h
@@ -15,10 +15,9 @@
 
 namespace GeoLib
 {
-	class GEOObjects;
-}
+class GEOObjects;
 
-namespace FileIO
+namespace IO
 {
 
 /// Write geometry given by the \c geo_objs object and specified by the name
@@ -28,5 +27,6 @@ namespace FileIO
 void writeGeometryToFile(std::string const& geo_name,
 	GeoLib::GEOObjects& geo_objs, std::string const& fname);
 }
+}
 
 #endif // WRITEGEOMETRYTOFILE_H
diff --git a/InSituLib/CMakeLists.txt b/InSituLib/CMakeLists.txt
index 0118d290cc4f82fc66bc7afa2116f718f489ce27..3ad4bc2b91465fd618c6597613d3ce9279bbed16 100644
--- a/InSituLib/CMakeLists.txt
+++ b/InSituLib/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_library(InSituLib
+add_library(InSituLib STATIC
 	VtkMappedMesh.h
 	VtkMappedMesh.cpp
 	VtkMappedMeshSource.h
diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp
index a84be65a97907e9a92f430bcac39ece6fa3377ab..e74f7fba4d1176b60349cb60bbe02713162cb16c 100644
--- a/MeshGeoToolsLib/GeoMapper.cpp
+++ b/MeshGeoToolsLib/GeoMapper.cpp
@@ -19,8 +19,8 @@
 
 #include <logog/include/logog.hpp>
 
-#include "FileIO/AsciiRasterInterface.h"
-#include "FileIO/readMeshFromFile.h"
+#include "GeoLib/IO/AsciiRasterInterface.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 
 #include "GeoLib/AABB.h"
 #include "GeoLib/AnalyticalGeometry.h"
@@ -50,7 +50,7 @@ GeoMapper::~GeoMapper()
 
 void GeoMapper::mapOnDEM(const std::string &file_name)
 {
-	_raster = FileIO::AsciiRasterInterface::getRasterFromASCFile(file_name);
+	_raster = GeoLib::IO::AsciiRasterInterface::getRasterFromASCFile(file_name);
 	if (! _raster) {
 		ERR("GeoMapper::mapOnDEM(): failed to load %s", file_name.c_str());
 		return;
@@ -70,7 +70,7 @@ void GeoMapper::mapOnDEM(const std::string &file_name)
 
 void GeoMapper::mapOnMesh(const std::string &file_name)
 {
-	MeshLib::Mesh *mesh (FileIO::readMeshFromFile(file_name));
+	MeshLib::Mesh *mesh (MeshLib::IO::readMeshFromFile(file_name));
 	mapOnMesh(mesh);
 	delete mesh;
 }
diff --git a/MeshLib/CMakeLists.txt b/MeshLib/CMakeLists.txt
index 32e897425607d972344a56ad144b8c5331ee8f70..130eda1e0ddd10370d3439d14f3ed3c8ea2b47d1 100644
--- a/MeshLib/CMakeLists.txt
+++ b/MeshLib/CMakeLists.txt
@@ -10,9 +10,21 @@ GET_SOURCE_FILES(SOURCES_ELEMENTS Elements)
 GET_SOURCE_FILES(SOURCES_EDITING MeshEditing)
 GET_SOURCE_FILES(SOURCES_GENERATORS MeshGenerators)
 GET_SOURCE_FILES(SOURCES_SEARCH MeshSearch)
+GET_SOURCE_FILES(SOURCES_IO IO)
+GET_SOURCE_FILES(SOURCES_IO_LEGACY IO/Legacy)
+GET_SOURCE_FILES(SOURCES_IO_VTKIO IO/VtkIO)
 
 GET_SOURCE_FILES(SOURCES_QUALITY MeshQuality)
-set(SOURCES ${SOURCES_MESHLIB} ${SOURCES_ELEMENTS} ${SOURCES_EDITING} ${SOURCES_GENERATORS} ${SOURCES_QUALITY} ${SOURCES_SEARCH})
+
+set(SOURCES ${SOURCES_MESHLIB} ${SOURCES_ELEMENTS} ${SOURCES_EDITING}
+    ${SOURCES_GENERATORS} ${SOURCES_QUALITY} ${SOURCES_SEARCH}
+    ${SOURCES_IO} ${SOURCES_IO_LEGACY}  ${SOURCES_IO_VTKIO})
+
+# It could be used for other MPI based DDC approach in future.
+if(OGS_USE_PETSC)
+	GET_SOURCE_FILES(SOURCES_MPI_IO IO/MPI_IO)
+	set(SOURCES ${SOURCES} ${SOURCES_MPI_IO})
+endif()
 
 # Create the library
 add_library(MeshLib STATIC ${SOURCES})
@@ -21,6 +33,7 @@ target_link_libraries(MeshLib
 	BaseLib
 	GeoLib
 	MathLib
+	InSituLib # VtkMappedMeshSource
 	${VTK_LIBRARIES}
 )
 
diff --git a/FileIO/Legacy/MeshIO.cpp b/MeshLib/IO/Legacy/MeshIO.cpp
similarity index 98%
rename from FileIO/Legacy/MeshIO.cpp
rename to MeshLib/IO/Legacy/MeshIO.cpp
index 283079bd49c4d33db388ded5394b6e128258c817..474dd143894abd2a8d2309660ef266e8f0819f82 100644
--- a/FileIO/Legacy/MeshIO.cpp
+++ b/MeshLib/IO/Legacy/MeshIO.cpp
@@ -32,7 +32,9 @@
 #include "MeshLib/Node.h"
 #include "MeshLib/Location.h"
 
-namespace FileIO
+namespace MeshLib
+{
+namespace IO
 {
 namespace Legacy {
 
@@ -332,5 +334,6 @@ std::string MeshIO::ElemType2StringOutput(const MeshLib::MeshElemType t) const
 	return "none";
 }
 
-}
-} // end namespace FileIO
+} // end namespace Legacy
+} // end namespace IO
+} // end namespace MeshLin
diff --git a/FileIO/Legacy/MeshIO.h b/MeshLib/IO/Legacy/MeshIO.h
similarity index 85%
rename from FileIO/Legacy/MeshIO.h
rename to MeshLib/IO/Legacy/MeshIO.h
index 1c5bfa60bf23b983bd39fb929c64749d7cf86479..69369c9066fb4331c473fb8a4cadee29759dcc91 100644
--- a/FileIO/Legacy/MeshIO.h
+++ b/MeshLib/IO/Legacy/MeshIO.h
@@ -21,25 +21,22 @@
 #include <vector>
 #include <boost/optional.hpp>
 
-#include "FileIO/Writer.h"
+#include "BaseLib/IO/Writer.h"
 #include "MeshLib/MeshEnums.h"
 #include "MeshLib/PropertyVector.h"
 
 namespace MeshLib
 {
-	class Mesh;
-	class Node;
-	class Element;
-	enum class MeshElemType;
-}
-
-
-namespace FileIO
+class Mesh;
+class Node;
+class Element;
+enum class MeshElemType;
+namespace IO
+{
+namespace Legacy
 {
-namespace Legacy {
-
 /// Interface for handling mesh files from OGS-5 and below. (*.msh files)
-class MeshIO : public Writer
+class MeshIO : public BaseLib::IO::Writer
 {
 public:
 	/// Constructor.
@@ -69,8 +66,8 @@ private:
 
 };  /* class */
 
-}
-} /* namespace FileIO */
+} // end namespace Legacy
+} // end namespace IO
+} // end namespace MeshLib
 
 #endif /* MESHIO_H_ */
-
diff --git a/FileIO/MPI_IO/NodePartitionedMeshReader.cpp b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp
similarity index 99%
rename from FileIO/MPI_IO/NodePartitionedMeshReader.cpp
rename to MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp
index eecab7e88040f87e44f21e7d0d35252ce192b38e..f1c45985f90b4adb9ee2e09c75db2d4589772a65 100644
--- a/FileIO/MPI_IO/NodePartitionedMeshReader.cpp
+++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp
@@ -36,7 +36,9 @@ is_safely_convertable(VALUE const& value)
     return result;
 }
 
-namespace FileIO
+namespace MeshLib
+{
+namespace IO
 {
 NodePartitionedMeshReader::NodePartitionedMeshReader(MPI_Comm comm)
     : _mpi_comm(comm)
@@ -509,4 +511,5 @@ void NodePartitionedMeshReader::setElements(
         }
     }
 }
-}   // namespace FileIO
+}   // namespace IO
+}   // namespace MeshLib
diff --git a/FileIO/MPI_IO/NodePartitionedMeshReader.h b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h
similarity index 99%
rename from FileIO/MPI_IO/NodePartitionedMeshReader.h
rename to MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h
index 6bdaffeb478b5c522277e2cb11f677f721ddac95..f879bb2b715443c1bc0719697055b8f0521f86ae 100644
--- a/FileIO/MPI_IO/NodePartitionedMeshReader.h
+++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h
@@ -26,9 +26,8 @@ namespace MeshLib
 {
 class Node;
 class Element;
-}
 
-namespace FileIO
+namespace IO
 {
 /// Class for parallel reading of ascii or binary partitioned mesh files into a
 /// NodePartitionedMesh via MPI.
@@ -251,6 +250,7 @@ private:
         std::vector<MeshLib::Element*> &mesh_elems,
         const bool ghost = false) const;
 };
-}   // FileIO
+}   // end namespace IO
+}   // end namespace MeshLib
 
 #endif  // READ_NODE_PARTITIONED_MESH_H
diff --git a/FileIO/VtkIO/VtuInterface-impl.h b/MeshLib/IO/VtkIO/VtuInterface-impl.h
similarity index 96%
rename from FileIO/VtkIO/VtuInterface-impl.h
rename to MeshLib/IO/VtkIO/VtuInterface-impl.h
index 23c7b97cde573270defcb67ce3343bc46c682201..f87f71f9437dcddb9588744a7a01dc2bbf91bb3a 100644
--- a/FileIO/VtkIO/VtuInterface-impl.h
+++ b/MeshLib/IO/VtkIO/VtuInterface-impl.h
@@ -26,7 +26,9 @@
 
 #include "InSituLib/VtkMappedMeshSource.h"
 
-namespace FileIO
+namespace MeshLib
+{
+namespace IO
 {
 
 template<typename UnstructuredGridWriter>
@@ -76,4 +78,5 @@ bool VtuInterface::writeVTU(std::string const &file_name, const int num_partitio
 	return (vtuWriter->Write() > 0);
 }
 
-}
+} // end namespace IO
+} // end namespace MeshLib
diff --git a/FileIO/VtkIO/VtuInterface.cpp b/MeshLib/IO/VtkIO/VtuInterface.cpp
similarity index 97%
rename from FileIO/VtkIO/VtuInterface.cpp
rename to MeshLib/IO/VtkIO/VtuInterface.cpp
index 8969aa6f74175d5ebbc69e9770ea077781cfb46d..014e58215eb49727b2b6f722671387a178789f5b 100644
--- a/FileIO/VtkIO/VtuInterface.cpp
+++ b/MeshLib/IO/VtkIO/VtuInterface.cpp
@@ -35,7 +35,9 @@
 #include "MeshLib/Mesh.h"
 #include "MeshLib/MeshGenerators/VtkMeshConverter.h"
 
-namespace FileIO
+namespace MeshLib
+{
+namespace IO
 {
 
 VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compress) :
@@ -101,5 +103,5 @@ bool VtuInterface::writeToFile(std::string const &file_name)
 	return writeVTU<vtkXMLUnstructuredGridWriter>(file_name);
 #endif
 }
-
-}
+} // end namespace IO
+} // end namespace MeshLib
diff --git a/FileIO/VtkIO/VtuInterface.h b/MeshLib/IO/VtkIO/VtuInterface.h
similarity index 95%
rename from FileIO/VtkIO/VtuInterface.h
rename to MeshLib/IO/VtkIO/VtuInterface.h
index 55f3215d4059c8eccdbb43faa7308d3320f594e9..6408d0034af43872c2003a4000ab0a2a5684070d 100644
--- a/FileIO/VtkIO/VtuInterface.h
+++ b/MeshLib/IO/VtkIO/VtuInterface.h
@@ -19,10 +19,9 @@
 #include <vtkXMLWriter.h>
 
 namespace MeshLib {
-	class Mesh;
-}
+class Mesh;
 
-namespace FileIO
+namespace IO
 {
 
 /**
@@ -57,7 +56,8 @@ private:
 	bool _use_compressor;
 };
 
-}
+} // end namespace IO
+} // end namespace MeshLib
 
 #include "VtuInterface-impl.h"
 
diff --git a/FileIO/readMeshFromFile.cpp b/MeshLib/IO/readMeshFromFile.cpp
similarity index 76%
rename from FileIO/readMeshFromFile.cpp
rename to MeshLib/IO/readMeshFromFile.cpp
index d70dc5557b4be7ec6c26e4467d639f048b094d40..0c84f973d8b6e0e9d4dd79546d4a4758770ac8c8 100644
--- a/FileIO/readMeshFromFile.cpp
+++ b/MeshLib/IO/readMeshFromFile.cpp
@@ -30,34 +30,37 @@
 
 #include "MeshLib/Mesh.h"
 
-#include "FileIO/Legacy/MeshIO.h"
-#include "FileIO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 #ifdef USE_PETSC
-#include "FileIO/MPI_IO/NodePartitionedMeshReader.h"
+#include "MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h"
 #include "MeshLib/NodePartitionedMesh.h"
 #endif
 
-namespace FileIO
+namespace MeshLib
+{
+namespace IO
 {
 MeshLib::Mesh* readMeshFromFile(const std::string &file_name)
 {
 #ifdef USE_PETSC
-	NodePartitionedMeshReader read_pmesh(PETSC_COMM_WORLD);
+	MeshLib::IO::NodePartitionedMeshReader read_pmesh(PETSC_COMM_WORLD);
 	const std::string file_name_base = BaseLib::dropFileExtension(file_name);
 	return read_pmesh.read(file_name_base);
 #else
 	if (BaseLib::hasFileExtension("msh", file_name))
 	{
-		Legacy::MeshIO meshIO;
+		MeshLib::IO::Legacy::MeshIO meshIO;
 		return meshIO.loadMeshFromFile(file_name);
 	}
 
 	if (BaseLib::hasFileExtension("vtu", file_name))
-		return VtuInterface::readVTUFile(file_name);
+		return MeshLib::IO::VtuInterface::readVTUFile(file_name);
 
 	ERR("readMeshFromFile(): Unknown mesh file format in file %s.", file_name.c_str());
 	return nullptr;
 #endif
 }
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace MeshLib
diff --git a/FileIO/readMeshFromFile.h b/MeshLib/IO/readMeshFromFile.h
similarity index 97%
rename from FileIO/readMeshFromFile.h
rename to MeshLib/IO/readMeshFromFile.h
index c30b1080db22a51ca24d579d14709aa222aa37ff..7fa9e8fa464ded7ae3a1d0cde86278332db7f497 100644
--- a/FileIO/readMeshFromFile.h
+++ b/MeshLib/IO/readMeshFromFile.h
@@ -24,11 +24,10 @@
 namespace MeshLib
 {
 class Mesh;
-}
 
-namespace FileIO
+namespace IO
 {
 MeshLib::Mesh* readMeshFromFile(const std::string &file_name);
 }
-
+}
 #endif // READMESHFROMFILE_H
diff --git a/FileIO/writeMeshToFile.cpp b/MeshLib/IO/writeMeshToFile.cpp
similarity index 76%
rename from FileIO/writeMeshToFile.cpp
rename to MeshLib/IO/writeMeshToFile.cpp
index c3286dcaaa1f86b0cd9bf76d48ff4a4503da1b2e..e15e9cb6ae220b4be3fef5d6a1b5f0fa83b2e41c 100644
--- a/FileIO/writeMeshToFile.cpp
+++ b/MeshLib/IO/writeMeshToFile.cpp
@@ -15,24 +15,27 @@
 
 #include "MeshLib/Mesh.h"
 
-#include "Legacy/MeshIO.h"
-#include "VtkIO/VtuInterface.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
-namespace FileIO
+namespace MeshLib
+{
+namespace IO
 {
 void writeMeshToFile(const MeshLib::Mesh &mesh, const std::string &file_name)
 {
 	if (BaseLib::hasFileExtension("msh", file_name))
 	{
-		Legacy::MeshIO meshIO;
+		MeshLib::IO::Legacy::MeshIO meshIO;
 		meshIO.setMesh(&mesh);
 		meshIO.writeToFile(file_name);
 	} else if (BaseLib::hasFileExtension("vtu", file_name)) {
-		FileIO::VtuInterface writer(&mesh);
+		MeshLib::IO::VtuInterface writer(&mesh);
 		writer.writeToFile(file_name);
 	} else {
 		ERR("writeMeshToFile(): Unknown mesh file format in file %s.", file_name.c_str());
 	}
 }
 
-} // end namespace FileIO
+} // end namespace IO
+} // end namespace MeshLib
diff --git a/FileIO/writeMeshToFile.h b/MeshLib/IO/writeMeshToFile.h
similarity index 96%
rename from FileIO/writeMeshToFile.h
rename to MeshLib/IO/writeMeshToFile.h
index bc5c52a2885737125653358e8994360ae894830f..ae58ed033c3dcf7dbfe522af9698f12048d0f36b 100644
--- a/FileIO/writeMeshToFile.h
+++ b/MeshLib/IO/writeMeshToFile.h
@@ -14,11 +14,10 @@
 namespace MeshLib
 {
 class Mesh;
-}
-
-namespace FileIO
+namespace IO
 {
 void writeMeshToFile(const MeshLib::Mesh &mesh, const std::string &file_name);
 }
+}
 
 #endif // WRITEMESHTOFILE_H_
diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h
index 160d24d47f8d65a7f82b70e7cba4473f5241d21c..cdf0fe4f329d4626e35ee5c1f10042f5eb30ae23 100644
--- a/ProcessLib/Process.h
+++ b/ProcessLib/Process.h
@@ -11,7 +11,7 @@
 #define PROCESS_LIB_PROCESS_H_
 
 #include "AssemblerLib/ComputeSparsityPattern.h"
-#include "FileIO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 #include "NumLib/ODESolver/ODESystem.h"
 #include "NumLib/ODESolver/TimeDiscretization.h"
 #include "NumLib/ODESolver/NonlinearSolver.h"
@@ -101,7 +101,7 @@ public:
 
 		// Write output file
 		DBUG("Writing output to \'%s\'.", file_name.c_str());
-		FileIO::VtuInterface vtu_interface(&_mesh, vtkXMLWriter::Binary, true);
+		MeshLib::IO::VtuInterface vtu_interface(&_mesh, vtkXMLWriter::Binary, true);
 		vtu_interface.writeToFile(file_name);
 	}
 
diff --git a/SimpleTests/MeshTests/MPI/NodePartitionedMeshTester.cpp b/SimpleTests/MeshTests/MPI/NodePartitionedMeshTester.cpp
index 2e816c183d434a810e9371f8afd8354291f1c544..f84440768d1eb10c74f4c84d86a0329b17ee052d 100644
--- a/SimpleTests/MeshTests/MPI/NodePartitionedMeshTester.cpp
+++ b/SimpleTests/MeshTests/MPI/NodePartitionedMeshTester.cpp
@@ -27,13 +27,12 @@
 #include "BaseLib/LogogCustomCout.h"
 #include "BaseLib/TemplateLogogFormatterSuppressedGCC.h"
 
-#include "FileIO/MPI_IO/NodePartitionedMeshReader.h"
+#include "MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h"
 
 #include "MeshLib/Node.h"
 #include "MeshLib/Elements/Element.h"
 
 using namespace MeshLib;
-using namespace FileIO;
 
 int main(int argc, char *argv[])
 {
@@ -60,7 +59,7 @@ int main(int argc, char *argv[])
 
     NodePartitionedMesh *mesh = nullptr;
     {
-        NodePartitionedMeshReader read_pmesh(MPI_COMM_WORLD);
+        MeshLib::IO::NodePartitionedMeshReader read_pmesh(MPI_COMM_WORLD);
         mesh = read_pmesh.read(file_name);
     }
     if (!mesh)
diff --git a/SimpleTests/MeshTests/MeshRead.cpp b/SimpleTests/MeshTests/MeshRead.cpp
index 018e0fbdabae68ca883d37387da9f92440c884f6..ba64b1558b58ee05a6be9f07e223044a34c5e286 100644
--- a/SimpleTests/MeshTests/MeshRead.cpp
+++ b/SimpleTests/MeshTests/MeshRead.cpp
@@ -21,7 +21,7 @@
 #include "BaseLib/StringTools.h"
 #include "BaseLib/FileTools.h"
 
-#include "FileIO/readMeshFromFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 
 #include "MeshLib/Node.h"
 #include "MeshLib/Elements/Element.h"
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
 #endif
 	BaseLib::RunTime run_time;
 	run_time.start();
-	MeshLib::Mesh* mesh = FileIO::readMeshFromFile(fname);
+	MeshLib::Mesh* mesh = MeshLib::IO::readMeshFromFile(fname);
 #ifndef WIN32
 	unsigned long mem_with_mesh (mem_watch.getVirtMemUsage());
 //	std::cout << "mem for mesh: " << (mem_with_mesh - mem_without_mesh)/(1024*1024) << " MB" << std::endl;
diff --git a/SimpleTests/MeshTests/MeshSearchTest.cpp b/SimpleTests/MeshTests/MeshSearchTest.cpp
index d59f661e3bdc04472cdced742de4db11637f71f7..52b0220959cb0b862a82c608655de51760f5637f 100644
--- a/SimpleTests/MeshTests/MeshSearchTest.cpp
+++ b/SimpleTests/MeshTests/MeshSearchTest.cpp
@@ -16,7 +16,7 @@
 #include "BaseLib/MemWatch.h"
 #include "BaseLib/RunTime.h"
 
-#include "FileIO/Legacy/MeshIO.h"
+#include "MeshLib/IO/Legacy/MeshIO.h"
 
 #include "GeoLib/Grid.h"
 
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
 
 	std::string fname (mesh_arg.getValue());
 
-	FileIO::Legacy::MeshIO mesh_io;
+	MeshLib::IO::Legacy::MeshIO mesh_io;
 #ifndef WIN32
 	BaseLib::MemWatch mem_watch;
 	unsigned long mem_without_mesh (mem_watch.getVirtMemUsage());
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index cd2f627f592d4c2020b6e6a52ed107f7d856557f..bcc9f942baeab3fac7012440348a322b076714fa 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -12,6 +12,7 @@ APPEND_SOURCE_FILES(TEST_SOURCES AssemblerLib)
 APPEND_SOURCE_FILES(TEST_SOURCES BaseLib)
 APPEND_SOURCE_FILES(TEST_SOURCES FileIO)
 APPEND_SOURCE_FILES(TEST_SOURCES GeoLib)
+APPEND_SOURCE_FILES(TEST_SOURCES GeoLib/IO)
 APPEND_SOURCE_FILES(TEST_SOURCES InSituLib)
 APPEND_SOURCE_FILES(TEST_SOURCES MathLib)
 APPEND_SOURCE_FILES(TEST_SOURCES MeshLib)
diff --git a/Tests/FileIO/TestBoostGmlInterface.cpp b/Tests/FileIO/TestBoostGmlInterface.cpp
index 39253ff7fdb687b08c26e5e990e0041cd4c8f574..fcb4d3023e7aaedd792550f155628e004c0e46d2 100644
--- a/Tests/FileIO/TestBoostGmlInterface.cpp
+++ b/Tests/FileIO/TestBoostGmlInterface.cpp
@@ -19,7 +19,7 @@
 #include "Tests/FileIO/TestGmlInterface.h"
 
 #include "BaseLib/BuildInfo.h"
-#include "FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
+#include "GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h"
 #include "GeoLib/GEOObjects.h"
 
 TEST_F(TestGmlInterface, BoostXmlGmlWriterReaderTest)
@@ -28,7 +28,7 @@ TEST_F(TestGmlInterface, BoostXmlGmlWriterReaderTest)
 	std::string test_data_file(BaseLib::BuildInfo::tests_tmp_path
 		+ "TestXmlGmlReader.gml");
 
-	FileIO::BoostXmlGmlInterface xml(geo_objects);
+	GeoLib::IO::BoostXmlGmlInterface xml(geo_objects);
 	xml.setNameForExport(geo_name);
 	int result = xml.writeToFile(test_data_file);
 	EXPECT_EQ(result, 1);
diff --git a/Tests/FileIO/TestTetGenInterface.cpp b/Tests/FileIO/TestTetGenInterface.cpp
index c6f042ae4f8b623764f7cfee54bd1e061afcdb9e..ea7d45479ccf897635c95b56f38759873be47977 100644
--- a/Tests/FileIO/TestTetGenInterface.cpp
+++ b/Tests/FileIO/TestTetGenInterface.cpp
@@ -19,7 +19,7 @@
 #include "gtest/gtest.h"
 
 #include "BaseLib/BuildInfo.h"
-#include "FileIO/readMeshFromFile.h"
+#include "MeshLib/IO/readMeshFromFile.h"
 #include "FileIO/TetGenInterface.h"
 #include "GeoLib/GEOObjects.h"
 #include "MeshLib/Mesh.h"
@@ -51,7 +51,7 @@ TEST(FileIO, DISABLED_TetGenSmeshInterface)
 #endif
 {
 	std::string const file_name (BaseLib::BuildInfo::data_path + "/FileIO/AmmerSubsurfaceCoarse.vtu");
-	std::unique_ptr<MeshLib::Mesh const> const mesh (FileIO::readMeshFromFile(file_name));
+	std::unique_ptr<MeshLib::Mesh const> const mesh (MeshLib::IO::readMeshFromFile(file_name));
 
 	std::string const tg_new_name ("TestSmeshWriter");
 	std::string const output_name(BaseLib::BuildInfo::tests_tmp_path + tg_new_name + ".smesh");
diff --git a/Tests/FileIO_Qt/TestQtGmlInterface.cpp b/Tests/FileIO_Qt/TestQtGmlInterface.cpp
index 0d5fd5cf19d3b13d155f245897b9d97a5e8dc79b..3941a3846db87cdfb8bfb1429a81de496b1782eb 100644
--- a/Tests/FileIO_Qt/TestQtGmlInterface.cpp
+++ b/Tests/FileIO_Qt/TestQtGmlInterface.cpp
@@ -19,7 +19,7 @@
 #include "Tests/FileIO/TestGmlInterface.h"
 
 #include "BaseLib/BuildInfo.h"
-#include "FileIO/XmlIO/Qt/XmlGmlInterface.h"
+#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
 #include "GeoLib/GEOObjects.h"
 
 TEST_F(TestGmlInterface, QtXmlGmlWriterReaderTest)
@@ -28,7 +28,7 @@ TEST_F(TestGmlInterface, QtXmlGmlWriterReaderTest)
 	std::string test_data_file(BaseLib::BuildInfo::tests_tmp_path
 		+ "TestXmlGmlReader.gml");
 
-	FileIO::XmlGmlInterface xml(geo_objects);
+	GeoLib::IO::XmlGmlInterface xml(geo_objects);
 	xml.setNameForExport(geo_name);
 	int result = xml.writeToFile(test_data_file);
 	EXPECT_EQ(result, 1);
diff --git a/Tests/FileIO/TestGLIReader.cpp b/Tests/GeoLib/IO/TestGLIReader.cpp
similarity index 89%
rename from Tests/FileIO/TestGLIReader.cpp
rename to Tests/GeoLib/IO/TestGLIReader.cpp
index 12fd2c5813b7d2b29d759d18ff3b9f467b2e36de..9f26262c7fc6b08aa111c3f92b13daee23811641 100644
--- a/Tests/FileIO/TestGLIReader.cpp
+++ b/Tests/GeoLib/IO/TestGLIReader.cpp
@@ -16,7 +16,7 @@
 #include "gtest/gtest.h"
 
 #include "BaseLib/BuildInfo.h"
-#include "FileIO/Legacy/OGSIOVer4.h"
+#include "GeoLib/IO/Legacy/OGSIOVer4.h"
 #include "GeoLib/GEOObjects.h"
 
 class OGSIOVer4InterfaceTest : public ::testing::Test
@@ -58,7 +58,7 @@ TEST_F(OGSIOVer4InterfaceTest, SimpleTIN)
 	GeoLib::GEOObjects geometries;
 	std::vector<std::string> errors;
 	std::string geometry_name("TestGeometry");
-	FileIO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
+	GeoLib::IO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
 
 	std::vector<GeoLib::Surface*> const*
 		sfcs(geometries.getSurfaceVec(geometry_name));
@@ -81,7 +81,7 @@ TEST_F(OGSIOVer4InterfaceTest, StillCorrectTINWihtAdditionalValueAtEndOfLine)
 	GeoLib::GEOObjects geometries;
 	std::vector<std::string> errors;
 	std::string geometry_name("TestGeometry");
-	FileIO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
+	GeoLib::IO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
 
 	std::vector<GeoLib::Surface*> const*
 		sfcs(geometries.getSurfaceVec(geometry_name));
@@ -103,7 +103,7 @@ TEST_F(OGSIOVer4InterfaceTest, InvalidTIN_ZeroAreaTri)
 	GeoLib::GEOObjects geometries;
 	std::vector<std::string> errors;
 	std::string geometry_name("TestGeometry");
-	FileIO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
+	GeoLib::IO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
 
 	std::vector<GeoLib::Surface*> const*
 		sfcs(geometries.getSurfaceVec(geometry_name));
@@ -126,7 +126,7 @@ TEST_F(OGSIOVer4InterfaceTest, InvalidTIN_LineDoesNotStartWithID)
 	GeoLib::GEOObjects geometries;
 	std::vector<std::string> errors;
 	std::string geometry_name("TestGeometry");
-	FileIO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
+	GeoLib::IO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
 
 	std::vector<GeoLib::Surface*> const*
 		sfcs(geometries.getSurfaceVec(geometry_name));
@@ -148,7 +148,7 @@ TEST_F(OGSIOVer4InterfaceTest, InvalidTIN_PointIsMissing)
 	GeoLib::GEOObjects geometries;
 	std::vector<std::string> errors;
 	std::string geometry_name("TestGeometry");
-	FileIO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
+	GeoLib::IO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
 
 	std::vector<GeoLib::Surface*> const*
 		sfcs(geometries.getSurfaceVec(geometry_name));
@@ -169,7 +169,7 @@ TEST_F(OGSIOVer4InterfaceTest, InvalidTIN_CoordOfPointIsMissing)
 	GeoLib::GEOObjects geometries;
 	std::vector<std::string> errors;
 	std::string geometry_name("TestGeometry");
-	FileIO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
+	GeoLib::IO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
 
 	std::vector<GeoLib::Surface*> const*
 		sfcs(geometries.getSurfaceVec(geometry_name));
@@ -190,7 +190,7 @@ TEST_F(OGSIOVer4InterfaceTest, SimpleTIN_AdditionalEmptyLinesAtEnd)
 	GeoLib::GEOObjects geometries;
 	std::vector<std::string> errors;
 	std::string geometry_name("TestGeometry");
-	FileIO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
+	GeoLib::IO::Legacy::readGLIFileV4(_gli_fname, geometries, geometry_name, errors);
 
 	std::vector<GeoLib::Surface*> const*
 		sfcs(geometries.getSurfaceVec(geometry_name));
@@ -200,4 +200,3 @@ TEST_F(OGSIOVer4InterfaceTest, SimpleTIN_AdditionalEmptyLinesAtEnd)
 
 	std::remove(tin_fname.c_str());
 }
-
diff --git a/Tests/InSituLib/TestVtkMappedMeshSource.cpp b/Tests/InSituLib/TestVtkMappedMeshSource.cpp
index 79f7ec9dd0d0df38cbbe7fff878ae988bb3e852e..0599345e61f6499284ec840ad4b67f819faee3fe 100644
--- a/Tests/InSituLib/TestVtkMappedMeshSource.cpp
+++ b/Tests/InSituLib/TestVtkMappedMeshSource.cpp
@@ -17,7 +17,7 @@
 #include <memory>
 #include <numeric>
 
-#include "FileIO/VtkIO/VtuInterface.h"
+#include "MeshLib/IO/VtkIO/VtuInterface.h"
 
 #include "InSituLib/VtkMappedMesh.h"
 #include "InSituLib/VtkMappedMeshSource.h"
@@ -216,7 +216,7 @@ TEST_F(InSituMesh, DISABLED_MappedMeshSourceRoundtrip)
 		{
 			if(dataMode == vtkXMLWriter::Ascii && compressed)
 				continue;
-			FileIO::VtuInterface vtuInterface(mesh, dataMode, compressed);
+			MeshLib::IO::VtuInterface vtuInterface(mesh, dataMode, compressed);
 			ASSERT_TRUE(vtuInterface.writeToFile(test_data_file));
 
 			// -- Read back VTK mesh
diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake
index 84d163bdf6d2695f7b34232def9002c375b72c20..bcb5afd5af4f7a0b1b651382ab92bd23caac76f5 100644
--- a/scripts/cmake/Find.cmake
+++ b/scripts/cmake/Find.cmake
@@ -134,6 +134,8 @@ if(OGS_USE_PETSC)
 
 endif()
 
+find_package(OpenSSL)
+
 ## Check MPI package
 if(OGS_USE_MPI)
 	find_package(MPI REQUIRED)