diff --git a/.gitignore b/.gitignore
index 5861b1e56adb7cc3c87bb3c10d66c1736ea8885c..cd7e137f773e8db3658210579cefcf02ee92d933 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,10 @@
 README.txt
 bin/
 build/
+build_debug/
 build_release/
+build-debug/
+build-release/
 lib/
 .idea/
 ./Wolf.user
@@ -30,7 +33,6 @@ src/CMakeFiles/cmake.check_cache
 src/examples/map_apriltag_save.yaml
 
 \.vscode/
-build_release/
 
 IMU.found
 imu.found
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a5f7a22602b39b58bcf1a0e7190b44d4cffe060f..ef29f921fb416b8178f4452a1082ebad5b7b5383 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,12 @@ stages:
   - build_and_test
 
 ############ YAML ANCHORS ############
+.print_variables_template: &print_variables_definition
+  # Print variables
+  - echo $WOLF_CORE_BRANCH
+  - echo $CI_COMMIT_BRANCH
+  - echo $WOLF_IMU_BRANCH
+
 .preliminaries_template: &preliminaries_definition
   ## Install ssh-agent if not already installed, it is required by Docker.
   ## (change apt-get to yum if you use an RPM-based image)
@@ -98,6 +104,7 @@ license_headers:
       paths:
       - ci_deps/wolf/
   before_script:
+    - *print_variables_definition
     - *preliminaries_definition
     - *install_wolf_definition
   script:
@@ -112,6 +119,7 @@ build_and_test:bionic:
       paths:
       - ci_deps/wolf/
   before_script:
+    - *print_variables_definition
     - *preliminaries_definition
     - *install_wolf_definition
   script:
@@ -126,6 +134,7 @@ build_and_test:focal:
       paths:
       - ci_deps/wolf/
   before_script:
+    - *print_variables_definition
     - *preliminaries_definition
     - *install_wolf_definition
   script:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea892d9b6b3b197e573e295313227fcb62286c09..5dc35a87041678cea8d4c047a345d7029f69b3ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,6 @@
 # Pre-requisites about cmake itself
-CMAKE_MINimuM_REQUIRED(VERSION 2.8)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
 
-if(COMMAND cmake_policy)
-  cmake_policy(SET CMP0005 NEW) 
-  cmake_policy(SET CMP0003 NEW)
-endif(COMMAND cmake_policy)
 # MAC OSX RPATH
 SET(CMAKE_MACOSX_RPATH 1)
 
@@ -14,9 +10,11 @@ set(PLUGIN_NAME "wolf${PROJECT_NAME}")
 
 MESSAGE("Starting ${PROJECT_NAME} CMakeLists ...")
 
+# Paths
 SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
 SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
-SET(CMAKE_INSTALL_PREFIX /usr/local)
+set(INCLUDE_INSTALL_DIR include/iri-algorithms/wolf)
+set(LIB_INSTALL_DIR lib/)
 
 IF (NOT CMAKE_BUILD_TYPE)
   SET(CMAKE_BUILD_TYPE "DEBUG")
@@ -24,7 +22,7 @@ ENDIF (NOT CMAKE_BUILD_TYPE)
 message(STATUS "Configured to compile in ${CMAKE_BUILD_TYPE} mode.")
 
 #Set Flags
-SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -O0 -D_REENTRANT")
+SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -D_REENTRANT")
 SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -D_REENTRANT")
 
 #Set compiler according C++14 support
@@ -67,10 +65,6 @@ if(BUILD_TESTS)
     enable_testing()
 endif()
 
-#CMAKE modules
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
-MESSAGE(STATUS ${CMAKE_MODULE_PATH})
-
 # Some wolf compilation options
 IF((CMAKE_BUILD_TYPE MATCHES DEBUG) OR (CMAKE_BUILD_TYPE MATCHES debug) OR (CMAKE_BUILD_TYPE MATCHES Debug))
   set(_WOLF_DEBUG true)
@@ -79,11 +73,13 @@ ENDIF()
 option(_WOLF_TRACE "Enable wolf tracing macro" ON)
 
 # ============ DEPENDENCIES ============ 
-FIND_PACKAGE(wolfcore REQUIRED)
+FIND_PACKAGE(wolfcore REQUIRED CONFIG)
+FIND_PACKAGE(Eigen3 3.3 REQUIRED CONFIG)
 
 # ============ config.h ============ 
-string(TOUPPER ${PROJECT_NAME} UPPER_NAME)
 set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR})
+# variable used to compile the config.h.in file
+string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
   
 # Define the directory where will be the configured config.h
 SET(WOLF_CONFIG_DIR ${PROJECT_BINARY_DIR}/conf/${PROJECT_NAME}/internal)
@@ -103,7 +99,6 @@ message("CONFIG DIRECTORY ${PROJECT_BINARY_DIR}")
 include_directories("${PROJECT_BINARY_DIR}/conf")
 
 # ============ INCLUDES SECTION ============ 
-INCLUDE_DIRECTORIES(${wolfcore_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(BEFORE "include")
 
 # ============ HEADERS ============ 
@@ -185,7 +180,8 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
 endif()
 
 #Link the created libraries
-TARGET_LINK_LIBRARIES(${PLUGIN_NAME} ${wolfcore_LIBRARIES})
+TARGET_LINK_LIBRARIES(${PLUGIN_NAME} PUBLIC wolfcore)
+TARGET_LINK_LIBRARIES(${PLUGIN_NAME} PUBLIC Eigen3::Eigen)
 
 #===============Build tests=========================
 IF(BUILD_TESTS)
@@ -194,39 +190,58 @@ IF(BUILD_TESTS)
 ENDIF(BUILD_TESTS)
 
 #install library
+#=============================================================
 INSTALL(TARGETS ${PLUGIN_NAME} EXPORT ${PLUGIN_NAME}Targets
-      RUNTIME DESTINATION bin
-      LIBRARY DESTINATION lib
-      ARCHIVE DESTINATION lib)
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+  ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+)
+install(EXPORT ${PLUGIN_NAME}Targets DESTINATION lib/${PLUGIN_NAME}/cmake)
+
+# Configure the package installation
+include(CMakePackageConfigHelpers)
+configure_package_config_file(
+  ${CMAKE_SOURCE_DIR}/cmake_modules/${PLUGIN_NAME}Config.cmake.in
+  ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}Config.cmake
+  INSTALL_DESTINATION ${LIB_INSTALL_DIR}/${PLUGIN_NAME}/cmake
+  PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR
+)
+
+install(
+  FILES 
+  ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}Config.cmake
+  DESTINATION 
+  ${LIB_INSTALL_DIR}/${PLUGIN_NAME}/cmake
+)
+
+# Specifies include directories to use when compiling the plugin target
+# This way, include_directories does not need to be called in plugins depending on this one
+target_include_directories(${PLUGIN_NAME} INTERFACE
+  $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
+)
 
-install(EXPORT ${PLUGIN_NAME}Targets DESTINATION lib/cmake/${PLUGIN_NAME})
 #install headers
 INSTALL(FILES ${HDRS_CAPTURE}
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/capture)
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/capture)
 INSTALL(FILES ${HDRS_FACTOR}
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/factor)
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/factor)
 INSTALL(FILES ${HDRS_FEATURE}
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/feature)
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/feature)
 INSTALL(FILES ${HDRS_MATH}
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/math)
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/math)
 INSTALL(FILES ${HDRS_PROCESSOR}
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/processor)
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/processor)
 INSTALL(FILES ${HDRS_SENSOR}
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/sensor)
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/sensor)
 
-FILE(WRITE imu.found "")
-INSTALL(FILES ${PROJECT_NAME}.found
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME})
 INSTALL(FILES "${WOLF_CONFIG_DIR}/config.h"
-  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/internal)
-
-INSTALL(FILES "${CMAKE_SOURCE_DIR}/cmake_modules/${PLUGIN_NAME}Config.cmake" DESTINATION "lib/cmake/${PLUGIN_NAME}")
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/internal)
 
 INSTALL(DIRECTORY ${SPDLOG_INCLUDE_DIRS} DESTINATION "include/iri-algorithms/")
 
 export(PACKAGE ${PLUGIN_NAME})
 
-FIND_PACKAGE(Doxygen)
+FIND_PACKAGE(Doxygen MODULE)
 
 FIND_PATH(IRI_DOC_DIR doxygen.conf ${CMAKE_SOURCE_DIR}/doc/iri_doc/)
 IF (IRI_DOC_DIR)
diff --git a/cmake_modules/wolfimuConfig.cmake b/cmake_modules/wolfimuConfig.cmake
deleted file mode 100644
index 9234912c0a54ff3e5aff5e1a44a27915cda83558..0000000000000000000000000000000000000000
--- a/cmake_modules/wolfimuConfig.cmake
+++ /dev/null
@@ -1,84 +0,0 @@
-#edit the following line to add the librarie's header files
-FIND_PATH(
-    wolfimu_INCLUDE_DIRS
-    NAMES imu.found
-    PATHS /usr/local/include/iri-algorithms/wolf/plugin_imu)
-IF(wolfimu_INCLUDE_DIRS)
-  MESSAGE("Found wolf imu include dirs: ${wolfimu_INCLUDE_DIRS}")
-ELSE(wolfimu_INCLUDE_DIRS)
-  MESSAGE("Couldn't find wolf imu include dirs")
-ENDIF(wolfimu_INCLUDE_DIRS)
-
-FIND_LIBRARY(
-    wolfimu_LIBRARIES
-    NAMES libwolfimu.so libwolfimu.dylib
-    PATHS /usr/local/lib)
-IF(wolfimu_LIBRARIES)
-  MESSAGE("Found wolf imu lib: ${wolfimu_LIBRARIES}")
-ELSE(wolfimu_LIBRARIES)
-  MESSAGE("Couldn't find wolf imu lib")
-ENDIF(wolfimu_LIBRARIES)
-
-IF (wolfimu_INCLUDE_DIRS AND wolfimu_LIBRARIES)
-   SET(wolfimu_FOUND TRUE)
- ELSE(wolfimu_INCLUDE_DIRS AND wolfimu_LIBRARIES)
-   set(wolfimu_FOUND FALSE)
-ENDIF (wolfimu_INCLUDE_DIRS AND wolfimu_LIBRARIES)
-
-IF (wolfimu_FOUND)
-   IF (NOT wolfimu_FIND_QUIETLY)
-      MESSAGE(STATUS "Found wolf imu: ${wolfimu_LIBRARIES}")
-   ENDIF (NOT wolfimu_FIND_QUIETLY)
-ELSE (wolfimu_FOUND)
-   IF (wolfimu_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find wolf imu")
-   ENDIF (wolfimu_FIND_REQUIRED)
-ENDIF (wolfimu_FOUND)
-
-
-macro(wolf_report_not_found REASON_MSG)
-  set(wolfimu_FOUND FALSE)
-  unset(wolfimu_INCLUDE_DIRS)
-  unset(wolfimu_LIBRARIES)
-
-  # Reset the CMake module path to its state when this script was called.
-  set(CMAKE_MODULE_PATH ${CALLERS_CMAKE_MODULE_PATH})
-
-  # Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by
-  # FindPackage() use the camelcase library name, not uppercase.
-  if (wolfimu_FIND_QUIETLY)
-    message(STATUS "Failed to find wolf imu- " ${REASON_MSG} ${ARGN})
-  elseif(wolfimu_FIND_REQUIRED)
-    message(FATAL_ERROR "Failed to find wolf imu - " ${REASON_MSG} ${ARGN})
-  else()
-    # Neither QUIETLY nor REQUIRED, use SEND_ERROR which emits an error
-    # that prevents generation, but continues configuration.
-    message(SEND_ERROR "Failed to find wolf imu - " ${REASON_MSG} ${ARGN})
-  endif ()
-  return()
-endmacro(wolf_report_not_found)
-
-if(NOT wolfimu_FOUND)
-  wolf_report_not_found("Something went wrong while setting up wolf imu.")
-endif(NOT wolfimu_FOUND)
-# Set the include directories for wolf (itself).
-set(wolfimu_FOUND TRUE)
-
-# Now we gather all the required dependencies for Wolf imu
-if(NOT wolf_FOUND)
-  FIND_PACKAGE(wolfcore REQUIRED)
-
-  #We reverse in order to insert at the start
-  list(REVERSE wolfimu_INCLUDE_DIRS)
-  list(APPEND wolfimu_INCLUDE_DIRS ${wolfcore_INCLUDE_DIRS})
-  list(REVERSE wolfimu_INCLUDE_DIRS)
-
-  list(REVERSE wolfimu_LIBRARIES)
-  list(APPEND wolfimu_LIBRARIES ${wolfcore_LIBRARIES})
-  list(REVERSE wolfimu_LIBRARIES)
-endif()
-
-# provide both INCLUDE_DIR and INCLUDE_DIRS
-SET(wolfimu_INCLUDE_DIR ${wolfimu_INCLUDE_DIRS})
-# provide both LIBRARY and LIBRARIES 
-SET(wolfimu_LIBRARY ${wolfimu_LIBRARIES})
diff --git a/cmake_modules/wolfimuConfig.cmake.in b/cmake_modules/wolfimuConfig.cmake.in
new file mode 100644
index 0000000000000000000000000000000000000000..86f0997f2390ebd3ff9d34a73a6a118953c4881e
--- /dev/null
+++ b/cmake_modules/wolfimuConfig.cmake.in
@@ -0,0 +1,12 @@
+set(@PLUGIN_NAME@_VERSION 0.0.1)
+
+
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+FIND_DEPENDENCY(wolfcore REQUIRED)
+FIND_DEPENDENCY(Eigen3 3.3 REQUIRED)
+
+include("${CMAKE_CURRENT_LIST_DIR}/@PLUGIN_NAME@Targets.cmake")
+
+check_required_components(@PLUGIN_NAME@)
\ No newline at end of file
diff --git a/include/imu/capture/capture_compass.h b/include/imu/capture/capture_compass.h
index dc1fef50b1e6cc25acf4154634da98af698f6e65..a9c164c5804e7d0c09041ef3507cf9f27f9d03d4 100644
--- a/include/imu/capture/capture_compass.h
+++ b/include/imu/capture/capture_compass.h
@@ -23,7 +23,7 @@
 #define CAPTURE_COMPASS_H_
 
 //Wolf includes
-#include "core/capture/capture_base.h"
+#include <core/capture/capture_base.h>
 #include "imu/sensor/sensor_compass.h"
 
 //std includes
diff --git a/include/imu/capture/capture_imu.h b/include/imu/capture/capture_imu.h
index 4b4e05a1caf32f4627a7bc78d8fffdc413a1acf8..3a93dec415add904e8715af22911412d8523ef87 100644
--- a/include/imu/capture/capture_imu.h
+++ b/include/imu/capture/capture_imu.h
@@ -24,7 +24,7 @@
 
 //Wolf includes
 #include "imu/math/imu_tools.h"
-#include "core/capture/capture_motion.h"
+#include <core/capture/capture_motion.h>
 
 namespace wolf {
     
diff --git a/include/imu/factor/factor_compass_3d.h b/include/imu/factor/factor_compass_3d.h
index 3772950880281c9b6e6261192d9ac3edb0f563cd..c58af6e1ae13b5744d24612a900a8986a95d0bf1 100644
--- a/include/imu/factor/factor_compass_3d.h
+++ b/include/imu/factor/factor_compass_3d.h
@@ -22,7 +22,7 @@
 #ifndef FACTOR_COMPASS_3D_H_
 #define FACTOR_COMPASS_3D_H_
 
-#include "core/factor/factor_autodiff.h"
+#include <core/factor/factor_autodiff.h>
 
 namespace wolf
 {
diff --git a/include/imu/factor/factor_fix_bias.h b/include/imu/factor/factor_fix_bias.h
index 2de0cf321f0cf93aefb50808c44afe3301f67fb1..dc6faf4c96fd2b1fa2c99f1cfa751b92f42f9e0a 100644
--- a/include/imu/factor/factor_fix_bias.h
+++ b/include/imu/factor/factor_fix_bias.h
@@ -26,9 +26,9 @@
 //Wolf includes
 #include "imu/capture/capture_imu.h"
 #include "imu/feature/feature_imu.h"
-#include "core/factor/factor_autodiff.h"
-#include "core/frame/frame_base.h"
-#include "core/math/rotations.h"
+#include <core/factor/factor_autodiff.h>
+#include <core/frame/frame_base.h>
+#include <core/math/rotations.h>
 
 //#include "ceres/jet.h"
 
diff --git a/include/imu/factor/factor_imu.h b/include/imu/factor/factor_imu.h
index 7bbae22c3f2f0598b60c19f1bad5d45e177ab0c0..9e752656f10de383513a406538da1f399c2ec1a7 100644
--- a/include/imu/factor/factor_imu.h
+++ b/include/imu/factor/factor_imu.h
@@ -26,8 +26,8 @@
 #include "imu/feature/feature_imu.h"
 #include "imu/sensor/sensor_imu.h"
 #include "imu/processor/processor_imu.h"
-#include "core/factor/factor_autodiff.h"
-#include "core/math/rotations.h"
+#include <core/factor/factor_autodiff.h>
+#include <core/math/rotations.h>
 
 //Eigen include
 
@@ -478,8 +478,8 @@ inline bool FactorImu::residual(const Eigen::MatrixBase<D1> &       _p1,
 
 inline Eigen::VectorXd FactorImu::expectation() const
 {
-    FrameBasePtr frm_current = getFeature()->getFrame();
-    FrameBasePtr frm_previous = getFrameOther();
+    auto frm_current = getFeature()->getFrame();
+    auto frm_previous = getFrameOther();
 
     //get information on current_frame in the FactorImu
     const Eigen::Vector3d frame_current_pos    = (frm_current->getP()->getState());
diff --git a/include/imu/factor/factor_imu2d.h b/include/imu/factor/factor_imu2d.h
index 5158c590fb2a6ecaf570cf6e0830fbc697437ded..11b87fee551371907a9ac38883d7c0f2c15fb5a2 100644
--- a/include/imu/factor/factor_imu2d.h
+++ b/include/imu/factor/factor_imu2d.h
@@ -26,9 +26,9 @@
 #include "imu/feature/feature_imu2d.h"
 #include "imu/processor/processor_imu2d.h"
 #include "imu/sensor/sensor_imu2d.h"
-#include "core/factor/factor_autodiff.h"
-#include "core/math/rotations.h"
 #include "imu/math/imu2d_tools.h"
+#include <core/factor/factor_autodiff.h>
+#include <core/math/rotations.h>
 
 //Eigen include
 
diff --git a/include/imu/factor/factor_imu2d_with_gravity.h b/include/imu/factor/factor_imu2d_with_gravity.h
index 6356a659e06a4a347607cff564cc8e03d581210b..681eb46c285d45c0e8e33674e37b850ca21890fb 100644
--- a/include/imu/factor/factor_imu2d_with_gravity.h
+++ b/include/imu/factor/factor_imu2d_with_gravity.h
@@ -26,11 +26,10 @@
 #include "imu/feature/feature_imu2d.h"
 #include "imu/processor/processor_imu2d.h"
 #include "imu/sensor/sensor_imu2d.h"
-#include "core/factor/factor_autodiff.h"
-#include "core/math/rotations.h"
 #include "imu/math/imu2d_tools.h"
+#include <core/factor/factor_autodiff.h>
+#include <core/math/rotations.h>
 
-//Eigen include
 
 namespace wolf {
     
diff --git a/include/imu/feature/feature_imu.h b/include/imu/feature/feature_imu.h
index 6aa5f45116edbe33ac4459868cf34b9819af4e3c..4efe5e4ed8e8f82f44c26cbe3c44202bc05ea8f2 100644
--- a/include/imu/feature/feature_imu.h
+++ b/include/imu/feature/feature_imu.h
@@ -24,8 +24,8 @@
 
 //Wolf includes
 #include "imu/capture/capture_imu.h"
-#include "core/feature/feature_base.h"
-#include "core/common/wolf.h"
+#include <core/feature/feature_base.h>
+#include <core/common/wolf.h>
 
 //std includes
 
diff --git a/include/imu/feature/feature_imu2d.h b/include/imu/feature/feature_imu2d.h
index 58f64b31afcd6610783359458a1261394d2726fa..0472550d4a60aaec2c398dfc213fe392f42c26c4 100644
--- a/include/imu/feature/feature_imu2d.h
+++ b/include/imu/feature/feature_imu2d.h
@@ -24,8 +24,8 @@
 
 //Wolf includes
 #include "imu/capture/capture_imu.h"
-#include "core/feature/feature_base.h"
-#include "core/common/wolf.h"
+#include <core/feature/feature_base.h>
+#include <core/common/wolf.h>
 
 //std includes
 
diff --git a/include/imu/math/imu2d_tools.h b/include/imu/math/imu2d_tools.h
index 4f2a1ef535d9a538c03228a81d6940e67c7439a2..f579ae2dc44fc2f7cd5a6d1b70ba49df21dfdcb7 100644
--- a/include/imu/math/imu2d_tools.h
+++ b/include/imu/math/imu2d_tools.h
@@ -29,10 +29,10 @@
 #ifndef IMU2D_TOOLS_H_
 #define IMU2D_TOOLS_H_
 
-#include "core/common/wolf.h"
-#include "core/math/rotations.h"
-#include "core/math/SE2.h"
-#include "core/state_block/state_composite.h"
+#include <core/common/wolf.h>
+#include <core/math/rotations.h>
+#include <core/math/SE2.h>
+#include <core/state_block/state_composite.h>
 
 #include <cstdio>
 
diff --git a/include/imu/math/imu_tools.h b/include/imu/math/imu_tools.h
index e696966cde5f21034b3e04d464c9c3305f5e4ec7..7101c04eb11afd5285fd2f77dd2f9c281780c5fc 100644
--- a/include/imu/math/imu_tools.h
+++ b/include/imu/math/imu_tools.h
@@ -29,9 +29,9 @@
 #ifndef IMU_TOOLS_H_
 #define IMU_TOOLS_H_
 
-#include "core/common/wolf.h"
-#include "core/math/rotations.h"
-#include "core/state_block/state_composite.h"
+#include <core/common/wolf.h>
+#include <core/math/rotations.h>
+#include <core/state_block/state_composite.h>
 
 #include <cstdio>
 
diff --git a/include/imu/processor/processor_compass.h b/include/imu/processor/processor_compass.h
index 71f572e6317be94c99a22d1431ef73be8d7a08cd..ca1cd6e725b63848706fb2f9a25c342fed2277ce 100644
--- a/include/imu/processor/processor_compass.h
+++ b/include/imu/processor/processor_compass.h
@@ -22,7 +22,7 @@
 #ifndef INCLUDE_IMU_PROCESSOR_PROCESSORCOMPASS_H_
 #define INCLUDE_IMU_PROCESSOR_PROCESSORCOMPASS_H_
 
-#include "core/processor/processor_base.h"
+#include <core/processor/processor_base.h>
 
 namespace wolf {
 
diff --git a/include/imu/processor/processor_imu.h b/include/imu/processor/processor_imu.h
index 12676c83d8536bc8f2ccbcc78eb288dfe74804cd..d8efc7cbd3221654da4721ff8bc21e6c15bc4353 100644
--- a/include/imu/processor/processor_imu.h
+++ b/include/imu/processor/processor_imu.h
@@ -25,7 +25,7 @@
 // Wolf
 #include "imu/capture/capture_imu.h"
 #include "imu/feature/feature_imu.h"
-#include "core/processor/processor_motion.h"
+#include <core/processor/processor_motion.h>
 
 namespace wolf {
 WOLF_STRUCT_PTR_TYPEDEFS(ParamsProcessorImu);
@@ -81,7 +81,7 @@ class ProcessorImu : public ProcessorMotion{
         Eigen::VectorXd deltaZero() const override;
         Eigen::VectorXd correctDelta(const Eigen::VectorXd& delta_preint,
                                              const Eigen::VectorXd& delta_step) const override;
-        VectorXd getCalibration (const CaptureBasePtr _capture = nullptr) const override;
+        VectorXd getCalibration (const CaptureBaseConstPtr _capture = nullptr) const override;
         void setCalibration(const CaptureBasePtr _capture, const VectorXd& _calibration) override;
         bool voteForKeyFrame() const override;
         CaptureMotionPtr emplaceCapture(const FrameBasePtr& _frame_own,
diff --git a/include/imu/processor/processor_imu2d.h b/include/imu/processor/processor_imu2d.h
index 433ccf6b92724169420813bdea8692cf5bc6777e..726666f48ab2878d2f86712a4fc35b79e7f7e31a 100644
--- a/include/imu/processor/processor_imu2d.h
+++ b/include/imu/processor/processor_imu2d.h
@@ -25,7 +25,7 @@
 // Wolf
 #include "imu/capture/capture_imu.h"
 #include "imu/feature/feature_imu.h"
-#include "core/processor/processor_motion.h"
+#include <core/processor/processor_motion.h>
 
 namespace wolf {
 WOLF_STRUCT_PTR_TYPEDEFS(ParamsProcessorImu2d);
@@ -81,7 +81,7 @@ class ProcessorImu2d : public ProcessorMotion{
         Eigen::VectorXd deltaZero() const override;
         Eigen::VectorXd correctDelta(const Eigen::VectorXd& delta_preint,
                                              const Eigen::VectorXd& delta_step) const override;
-        VectorXd getCalibration (const CaptureBasePtr _capture) const override;
+        VectorXd getCalibration (const CaptureBaseConstPtr _capture) const override;
         void setCalibration(const CaptureBasePtr _capture, const VectorXd& _calibration) override;
         bool voteForKeyFrame() const override;
         CaptureMotionPtr emplaceCapture(const FrameBasePtr& _frame_own,
diff --git a/include/imu/sensor/sensor_compass.h b/include/imu/sensor/sensor_compass.h
index a446b8acabf40ace81f7280d931d14eb8faedb32..c9f1d60551ce37ae7c9c5cd46283a832b19faa83 100644
--- a/include/imu/sensor/sensor_compass.h
+++ b/include/imu/sensor/sensor_compass.h
@@ -23,8 +23,9 @@
 #define SENSOR_SENSOR_COMPASS_H_
 
 //wolf includes
-#include "core/sensor/sensor_base.h"
-#include "core/utils/params_server.h"
+#include <core/sensor/sensor_base.h>
+#include <core/utils/params_server.h>
+
 #include <iostream>
 
 namespace wolf {
diff --git a/include/imu/sensor/sensor_imu.h b/include/imu/sensor/sensor_imu.h
index dd21d8859880c52758152a445996298cdad08d48..0b9cf145a65d88704296ff7f0dcf54069356595c 100644
--- a/include/imu/sensor/sensor_imu.h
+++ b/include/imu/sensor/sensor_imu.h
@@ -23,8 +23,9 @@
 #define SENSOR_IMU_H
 
 //wolf includes
-#include "core/sensor/sensor_base.h"
-#include "core/utils/params_server.h"
+#include <core/sensor/sensor_base.h>
+#include <core/utils/params_server.h>
+
 #include <iostream>
 
 namespace wolf {
diff --git a/include/imu/sensor/sensor_imu2d.h b/include/imu/sensor/sensor_imu2d.h
index fb9bc31fab1b4e37322cbd6547dfe59700af5bb8..e1e5321e6d8af18278955fd7e86879a1425a0add 100644
--- a/include/imu/sensor/sensor_imu2d.h
+++ b/include/imu/sensor/sensor_imu2d.h
@@ -23,8 +23,9 @@
 #define SENSOR_IMU2D_H
 
 //wolf includes
-#include "core/sensor/sensor_base.h"
-#include "core/utils/params_server.h"
+#include <core/sensor/sensor_base.h>
+#include <core/utils/params_server.h>
+
 #include <iostream>
 
 namespace wolf {
diff --git a/internal/config.h.in b/internal/config.h.in
index 7014ca320e5c5fea1f59a6fe5d9d1ea0987bf95e..35f3468331656ba09a63ad7f26e5c0fb78c8d5bc 100644
--- a/internal/config.h.in
+++ b/internal/config.h.in
@@ -24,13 +24,13 @@
 //            which will be added to the include path for compilation,
 //            and installed with the public wolf headers.
 
-#ifndef WOLF_INTERNAL_${UPPER_NAME}_CONFIG_H_
-#define WOLF_INTERNAL_${UPPER_NAME}_CONFIG_H_
+#ifndef WOLF_INTERNAL_${PROJECT_NAME_UPPER}_CONFIG_H_
+#define WOLF_INTERNAL_${PROJECT_NAME_UPPER}_CONFIG_H_
 
 #cmakedefine _WOLF_DEBUG
 
 #cmakedefine _WOLF_TRACE
 
-#define _WOLF_${UPPER_NAME}_ROOT_DIR "${_WOLF_ROOT_DIR}"
+#define _WOLF_${PROJECT_NAME_UPPER}_ROOT_DIR "${_WOLF_ROOT_DIR}"
 
 #endif /* WOLF_INTERNAL_CONFIG_H_ */
diff --git a/src/processor/processor_imu.cpp b/src/processor/processor_imu.cpp
index 69dbf111bc7a5bbcd4ad11796633338c5e877083..5e429fd80355bddf587eaccafec7bf4db8476b02 100644
--- a/src/processor/processor_imu.cpp
+++ b/src/processor/processor_imu.cpp
@@ -102,7 +102,7 @@ FeatureBasePtr ProcessorImu::emplaceFeature(CaptureMotionPtr _capture_motion)
     return feature;
 }
 
-VectorXd ProcessorImu::getCalibration (const CaptureBasePtr _capture) const
+VectorXd ProcessorImu::getCalibration (const CaptureBaseConstPtr _capture) const
 {
     if (_capture)
         return _capture->getStateBlock('I')->getState();
@@ -244,7 +244,7 @@ Eigen::VectorXd ProcessorImu::correctDelta (const Eigen::VectorXd& delta_preint,
 
 } // namespace wolf
 
-// Register in the FactorySensor
+// Register in the FactoryProcessor
 #include "core/processor/factory_processor.h"
 
 namespace wolf
diff --git a/src/processor/processor_imu2d.cpp b/src/processor/processor_imu2d.cpp
index 036d488e88371d3f4a9628452f1ecd7e7f0e172a..dc35d28c0a43844868505597948fed1315b83af3 100644
--- a/src/processor/processor_imu2d.cpp
+++ b/src/processor/processor_imu2d.cpp
@@ -111,7 +111,7 @@ namespace wolf {
     return feature;
   }
 
-  VectorXd ProcessorImu2d::getCalibration (const CaptureBasePtr _capture) const
+  VectorXd ProcessorImu2d::getCalibration (const CaptureBaseConstPtr _capture) const
   {
       if (_capture)
           return _capture->getStateBlock('I')->getState();
@@ -214,7 +214,7 @@ namespace wolf {
      *
      * In the absence of gravity (2D case) it's the same as deltaPlusDelta(), so the same compose() function is used
      */
-    if( std::static_pointer_cast<SensorImu2d>(getSensor())->isGravityOrthogonal() ) 
+    if( std::static_pointer_cast<const SensorImu2d>(getSensor())->isGravityOrthogonal() ) 
         _x_plus_delta = imu2d::composeOverState(_x, delta, _dt);
     else
       _x_plus_delta = imu2d::composeOverStateWithGravity(_x, delta, _dt, getSensor()->getState("G"));
diff --git a/src/yaml/processor_imu2d_yaml.cpp b/src/yaml/processor_imu2d_yaml.cpp
index b1d1e282e4991d7ad991d5e6f5a70bb31984c187..5939591be9ec9ac68cc73783f28b41be28559cd8 100644
--- a/src/yaml/processor_imu2d_yaml.cpp
+++ b/src/yaml/processor_imu2d_yaml.cpp
@@ -31,7 +31,7 @@
 #include "core/yaml/yaml_conversion.h"
 
 // wolf
-#include "core/common/factory.h"
+#include "core/processor/factory_processor.h"
 
 // yaml-cpp library
 #include <yaml-cpp/yaml.h>
diff --git a/src/yaml/processor_imu_yaml.cpp b/src/yaml/processor_imu_yaml.cpp
index 30221d8e0350f1bcf840acd0fddcba2f2f845e8e..199f59af44bd61d5dcf60ce1a815def2e3cb950a 100644
--- a/src/yaml/processor_imu_yaml.cpp
+++ b/src/yaml/processor_imu_yaml.cpp
@@ -31,7 +31,7 @@
 #include "core/yaml/yaml_conversion.h"
 
 // wolf
-#include "core/common/factory.h"
+#include "core/processor/factory_processor.h"
 
 // yaml-cpp library
 #include <yaml-cpp/yaml.h>
diff --git a/src/yaml/sensor_imu2d_yaml.cpp b/src/yaml/sensor_imu2d_yaml.cpp
index a138b56bf11564a794893c872eecb297d10a1634..587297d42b4700a259a41e77a12c1b1967a19c31 100644
--- a/src/yaml/sensor_imu2d_yaml.cpp
+++ b/src/yaml/sensor_imu2d_yaml.cpp
@@ -31,7 +31,7 @@
 #include "core/yaml/yaml_conversion.h"
 
 // wolf
-#include "core/common/factory.h"
+#include "core/sensor/factory_sensor.h"
 
 // yaml-cpp library
 #include <yaml-cpp/yaml.h>
diff --git a/src/yaml/sensor_imu_yaml.cpp b/src/yaml/sensor_imu_yaml.cpp
index fbee701af0d92988fd0833da9aac2dbbee5927c4..e530b244596d202833a88b6c9c48150025d7ec6f 100644
--- a/src/yaml/sensor_imu_yaml.cpp
+++ b/src/yaml/sensor_imu_yaml.cpp
@@ -31,7 +31,7 @@
 #include "core/yaml/yaml_conversion.h"
 
 // wolf
-#include "core/common/factory.h"
+#include "core/sensor/factory_sensor.h"
 
 // yaml-cpp library
 #include <yaml-cpp/yaml.h>
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index bc10d2bf34366c9dbd624d62a8fffa92b1fb2598..3318eba7174a462947ffbf26f33497389dc75400 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -2,66 +2,45 @@
 add_subdirectory(gtest)
 
 
-# Include gtest directory.
-include_directories(${GTEST_INCLUDE_DIRS})
-
 ############# USE THIS TEST AS AN EXAMPLE #################
 #                                                         #
 # Create a specific test executable for gtest_example     #
 wolf_add_gtest(gtest_example gtest_example.cpp)           #
-target_link_libraries(gtest_example ${PLUGIN_NAME})      #
 #                                                         #
 ###########################################################
 
 wolf_add_gtest(gtest_processor_imu gtest_processor_imu.cpp)
-target_link_libraries(gtest_processor_imu ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_processor_imu2d gtest_processor_imu2d.cpp)
-target_link_libraries(gtest_processor_imu2d ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_processor_imu2d_with_gravity gtest_processor_imu2d_with_gravity.cpp)
-target_link_libraries(gtest_processor_imu2d_with_gravity ${PLUGIN_NAME} ${wolf_LIBRARY})
 
 wolf_add_gtest(gtest_imu gtest_imu.cpp)
-target_link_libraries(gtest_imu ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_imu_tools gtest_imu_tools.cpp)
-target_link_libraries(gtest_imu_tools ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_imu2d_tools gtest_imu2d_tools.cpp)
-target_link_libraries(gtest_imu2d_tools ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_processor_imu_jacobians gtest_processor_imu_jacobians.cpp)
-target_link_libraries(gtest_processor_imu_jacobians ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_feature_imu gtest_feature_imu.cpp)
-target_link_libraries(gtest_feature_imu ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_factor_imu2d gtest_factor_imu2d.cpp)
-target_link_libraries(gtest_factor_imu2d ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_imu_static_init gtest_imu_static_init.cpp)
-target_link_libraries(gtest_imu_static_init ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_imu2d_static_init gtest_imu2d_static_init.cpp)
-target_link_libraries(gtest_imu2d_static_init ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_factor_imu2d_with_gravity gtest_factor_imu2d_with_gravity.cpp)
-target_link_libraries(gtest_factor_imu2d_with_gravity ${PLUGIN_NAME} ${wolf_LIBRARY})
 
 wolf_add_gtest(gtest_imu_mocap_fusion gtest_imu_mocap_fusion.cpp)
-target_link_libraries(gtest_imu_mocap_fusion ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_factor_compass_3d gtest_factor_compass_3d.cpp)
-target_link_libraries(gtest_factor_compass_3d ${PLUGIN_NAME})
 
 # Has been excluded from tests for god knows how long, so thing is broken.
 # Maybe call an archeologist to fix this thing?
 # wolf_add_gtest(gtest_factor_imu gtest_factor_imu.cpp)
-# target_link_libraries(gtest_factor_imu ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_processor_motion_intrinsics_update gtest_processor_motion_intrinsics_update.cpp)
-target_link_libraries(gtest_processor_motion_intrinsics_update ${PLUGIN_NAME})
 
 wolf_add_gtest(gtest_sensor_compass gtest_sensor_compass.cpp)
-target_link_libraries(gtest_sensor_compass ${PLUGIN_NAME})
diff --git a/test/gtest/CMakeLists.txt b/test/gtest/CMakeLists.txt
index 559756b02472653c655c44152c452ba8767ef6f2..6209d341bcd32308bd522ab1990eb0cc82692012 100644
--- a/test/gtest/CMakeLists.txt
+++ b/test/gtest/CMakeLists.txt
@@ -1,65 +1,73 @@
-cmake_minimum_required(VERSION 2.8.8)
-project(gtest_builder C CXX)
+if(${CMAKE_VERSION} VERSION_LESS "3.11.0") 
+  message("CMake version less than 3.11.0")
 
-# We need thread support
-#find_package(Threads REQUIRED)
+  # Enable ExternalProject CMake module
+  include(ExternalProject)
 
-# Enable ExternalProject CMake module
-include(ExternalProject)
+  set(GTEST_FORCE_SHARED_CRT ON)
+  set(GTEST_DISABLE_PTHREADS ON) # without this in ubuntu 18.04 we get linking errors
 
-set(GTEST_FORCE_SHARED_CRT ON)
-set(GTEST_DISABLE_PTHREADS OFF)
+  # Download GoogleTest
+  ExternalProject_Add(googletest
+      GIT_REPOSITORY https://github.com/google/googletest.git
+      GIT_TAG        v1.8.x
+      # TIMEOUT 1 # We'll try this
+      CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
+      -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
+      -DCMAKE_CXX_FLAGS=${MSVC_COMPILER_DEFS}
+      -Dgtest_force_shared_crt=${GTEST_FORCE_SHARED_CRT}
+      -Dgtest_disable_pthreads=${GTEST_DISABLE_PTHREADS}
+      -DBUILD_GTEST=ON
+      PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
+      # Disable install step
+      INSTALL_COMMAND ""
+      UPDATE_DISCONNECTED 1 # 1: do not update googletest; 0: update googletest via github
+  )
 
-# For some reason I need to disable PTHREADS
-# with g++ (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
-# This is a known issue for MinGW :
-# https://github.com/google/shaderc/pull/174
-#if(MINGW)
-    set(GTEST_DISABLE_PTHREADS ON)
-#endif()
+  # Get GTest source and binary directories from CMake project
 
-# Download GoogleTest
-ExternalProject_Add(googletest
-    GIT_REPOSITORY https://github.com/google/googletest.git
-    GIT_TAG        v1.8.x
-    # TIMEOUT 1 # We'll try this
-    CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
-    -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
-    -DCMAKE_CXX_FLAGS=${MSVC_COMPILER_DEFS}
-    -Dgtest_force_shared_crt=${GTEST_FORCE_SHARED_CRT}
-    -Dgtest_disable_pthreads=${GTEST_DISABLE_PTHREADS}
-    -DBUILD_GTEST=ON
-    PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
-    # Disable install step
-    INSTALL_COMMAND ""
-    UPDATE_DISCONNECTED 1 # 1: do not update googletest; 0: update googletest via github
-)
+  # Specify include dir
+  ExternalProject_Get_Property(googletest source_dir)
+  set(GTEST_INCLUDE_DIRS ${source_dir}/googletest/include PARENT_SCOPE)
 
-# Get GTest source and binary directories from CMake project
+  # Specify MainTest's link libraries
+  ExternalProject_Get_Property(googletest binary_dir)
+  set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest PARENT_SCOPE)
 
-# Specify include dir
-ExternalProject_Get_Property(googletest source_dir)
-set(GTEST_INCLUDE_DIRS ${source_dir}/googletest/include PARENT_SCOPE)
+  # Create a libgtest target to be used as a dependency by test programs
+  add_library(libgtest IMPORTED STATIC GLOBAL)
+  add_dependencies(libgtest googletest)
 
-# Specify MainTest's link libraries
-ExternalProject_Get_Property(googletest binary_dir)
-set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest PARENT_SCOPE)
+  # Set libgtest properties
+  set_target_properties(libgtest PROPERTIES
+      "IMPORTED_LOCATION" "${binary_dir}/googlemock/gtest/libgtest.a"
+      "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
+  )
 
-# Create a libgtest target to be used as a dependency by test programs
-add_library(libgtest IMPORTED STATIC GLOBAL)
-add_dependencies(libgtest googletest)
+else()
 
-# Set libgtest properties
-set_target_properties(libgtest PROPERTIES
-    "IMPORTED_LOCATION" "${binary_dir}/googlemock/gtest/libgtest.a"
-    "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
-)
+  message("CMake version equal or greater than 3.11.0")
 
+  include(FetchContent)
+
+  FetchContent_Declare(
+    googletest
+    GIT_REPOSITORY https://github.com/google/googletest.git 
+    GIT_TAG main)
+
+  SET(INSTALL_GTEST OFF) # Disable installation of googletest
+  FetchContent_MakeAvailable(googletest)
+    
+endif()
+  
 function(wolf_add_gtest target)
   add_executable(${target} ${ARGN})
-  add_dependencies(${target} libgtest)
-  target_link_libraries(${target} libgtest)
-
-  #WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+  if(${CMAKE_VERSION} VERSION_LESS "3.11.0") 
+    add_dependencies(${target} libgtest)
+    target_link_libraries(${target} libgtest ${PLUGIN_NAME})
+    target_include_directories(${target} PUBLIC ${GTEST_INCLUDE_DIRS})
+  else()
+    target_link_libraries(${target} gtest_main ${PLUGIN_NAME})
+  endif()
   add_test(NAME ${target} COMMAND ${target})
 endfunction()
diff --git a/test/gtest_imu2d_static_init.cpp b/test/gtest_imu2d_static_init.cpp
index ddf1624c4a9c7c9d44c6ce43c35d8f975c8d2494..63d20e2e9b3a9d2b813802aca3f0ab0af187cefe 100644
--- a/test/gtest_imu2d_static_init.cpp
+++ b/test/gtest_imu2d_static_init.cpp
@@ -329,11 +329,9 @@ class ProcessorImu2dStaticInitTest : public testing::Test
 
           // add zero displacement and rotation capture & feature & factor with all previous frames
           assert(sensor_ptr_->getProblem());
-          for (auto frm_pair =  sensor_ptr_->getProblem()->getTrajectory()->begin();
-              frm_pair != sensor_ptr_->getProblem()->getTrajectory()->end();
-              frm_pair++)
+          for (auto frm_pair : sensor_ptr_->getProblem()->getTrajectory()->getFrameMap())
           {
-            if (frm_pair->second == last_frame_)
+            if (frm_pair.second == last_frame_)
               break;
             auto capture_zero = CaptureBase::emplace<CaptureVoid>(last_frame_, last_frame_->getTimeStamp(), nullptr);
 
@@ -344,7 +342,7 @@ class ProcessorImu2dStaticInitTest : public testing::Test
 
             FactorBase::emplace<FactorRelativePose2d>(feature_zero,
                 feature_zero,
-                frm_pair->second,
+                frm_pair.second,
                 nullptr,
                 false,
                 TOP_MOTION);
@@ -443,7 +441,6 @@ class ProcessorImu2dStaticInitTest : public testing::Test
 };
 
 
-
 TEST_F(ProcessorImu2dStaticInitTest, static_bias_aX_initial_guess_zero)
 {
    Vector3d body_magnitudes = Vector3d::Zero();
diff --git a/test/gtest_imu_static_init.cpp b/test/gtest_imu_static_init.cpp
index e0c769b4a30a4d1dc122be4ebe88622634186e1a..e4eb78b29764bb30340448a3235199fb640e51c8 100644
--- a/test/gtest_imu_static_init.cpp
+++ b/test/gtest_imu_static_init.cpp
@@ -339,11 +339,9 @@ class ProcessorImuStaticInitTest : public testing::Test
 
           // add zero displacement and rotation capture & feature & factor with all previous frames
           assert(sensor_ptr_->getProblem());
-          for (auto frm_pair =  sensor_ptr_->getProblem()->getTrajectory()->begin();
-              frm_pair != sensor_ptr_->getProblem()->getTrajectory()->end();
-              frm_pair++)
+          for (auto frm_pair : sensor_ptr_->getProblem()->getTrajectory()->getFrameMap())
           {
-            if (frm_pair->second == last_frame_)
+            if (frm_pair.second == last_frame_)
               break;
             auto capture_zero = CaptureBase::emplace<CaptureVoid>(last_frame_, last_frame_->getTimeStamp(), nullptr);
 
@@ -354,11 +352,10 @@ class ProcessorImuStaticInitTest : public testing::Test
 
             FactorBase::emplace<FactorRelativePose3d>(feature_zero,
                 feature_zero,
-                frm_pair->second,
+                frm_pair.second,
                 nullptr,
                 false,
                 TOP_MOTION);
-
           }
 
           // impose static
diff --git a/test/gtest_processor_imu.cpp b/test/gtest_processor_imu.cpp
index 6255fa38517be1218fcd6e39647c18e2151974c6..9af67f31fd02d661d75c5b15e54947f9cf3f5437 100644
--- a/test/gtest_processor_imu.cpp
+++ b/test/gtest_processor_imu.cpp
@@ -196,7 +196,7 @@ TEST(ProcessorImu, voteForKeyFrame)
         - 1 KeyFrame at origin
         - 1 keyframe created by process() in voteForKeyFrame() since conditions to create a keyframe are met
     */
-    ASSERT_EQ(problem->getTrajectory()->getFrameMap().size(),(unsigned int) 2);
+    ASSERT_EQ(problem->getTrajectory()->size(),(unsigned int) 2);
 
     /* if max_time_span == 2,  Wolf tree should be
 
diff --git a/test/gtest_processor_imu2d.cpp b/test/gtest_processor_imu2d.cpp
index 87c3619d3fbe37425bfc62bb6c0e2b17cfc40d9c..eabb79523f4952dd885c8432363071aef3dab7a9 100644
--- a/test/gtest_processor_imu2d.cpp
+++ b/test/gtest_processor_imu2d.cpp
@@ -137,7 +137,7 @@ TEST_F(ProcessorImu2dTest, Prior)
     auto KF0 = problem->setPriorFix(x0c, t0);
     processor_motion->setOrigin(KF0);
     //WOLF_DEBUG("x0 =", x0c);
-    //WOLF_DEBUG("KF0 state =", problem->getTrajectory()->getFrameMap().at(t)->getState("POV"));
+    //WOLF_DEBUG("KF0 state =", problem->getTrajectory()->getFrameMap().at(t0)->getState("POV"));
 }
 
 TEST_F(ProcessorImu2dTest, MRUA)
diff --git a/test/gtest_processor_motion_intrinsics_update.cpp b/test/gtest_processor_motion_intrinsics_update.cpp
index 93ba8561b5b4fea55e814cc9d3b68501ae2439ac..0d77493e9c809bb3cc9094584714142777baf6bc 100644
--- a/test/gtest_processor_motion_intrinsics_update.cpp
+++ b/test/gtest_processor_motion_intrinsics_update.cpp
@@ -221,7 +221,7 @@ TEST_F(ProcessorImuTest, getState)
 #endif
 
 
-        if (problem_->getTrajectory()->getFrameMap().size() > nb_kf){
+        if (problem_->getTrajectory()->size() > nb_kf){
             FrameBasePtr KF = problem_->getTrajectory()->getLastFrame();
             KF->setState(integrateX(AX, KF->getTimeStamp().get())); 
             KF->fix();
@@ -229,7 +229,7 @@ TEST_F(ProcessorImuTest, getState)
             solver_->solve();
             problem_->print(4, true, true, true);
 
-            nb_kf = problem_->getTrajectory()->getFrameMap().size();
+            nb_kf = problem_->getTrajectory()->size();
 
 #if WRITE_CSV_FILE
             // post-solve print to CSV with time-stamp shifted by dt/2 to separate from pre-solve  result
@@ -262,22 +262,17 @@ TEST_F(ProcessorImuTest, getState)
      * though we only test at KFs so t = { 0, 1, 2, 3 }
      */
 
-    for (auto F : *problem_->getTrajectory() )
+    for (auto F_pair : problem_->getTrajectory()->getFrameMap() )
     {
-        auto ts = F->getTimeStamp();
+        auto ts = F_pair.second->getTimeStamp();
 
         double bias = (t == 0 ? 0.42 : 0.0);
-        ASSERT_NEAR(F->getCaptureOf(sensor_)->getSensorIntrinsic()->getState()(0), bias, 1e-6);
-        ASSERT_NEAR(F->getP()->getState()(0),0.0,1e-6);
-        ASSERT_NEAR(F->getV()->getState()(0),0.0,1e-6);
+        ASSERT_NEAR(F_pair.second->getCaptureOf(sensor_)->getSensorIntrinsic()->getState()(0), bias, 1e-6);
+        ASSERT_NEAR(F_pair.second->getP()->getState()(0),0.0,1e-6);
+        ASSERT_NEAR(F_pair.second->getV()->getState()(0),0.0,1e-6);
     }
-
 }
 
-
-
-
-
 int main(int argc, char **argv)
 {
   testing::InitGoogleTest(&argc, argv);