diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f18d46bf23199b5d4d3bcc34d80735eea190570..b2025647ecc118d5a38e078c41e571375183ffd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,12 +193,6 @@ if (NOT DEFINED ENV{CI})
   add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 endif (NOT DEFINED ENV{CI})
 
-#+++++++++++++++++++++++++++++
-# Options
-#
-# HISTORY option selection
-option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
-
 #+++++++++++++++++++++++++++++
 # Externals
 #
@@ -346,13 +340,9 @@ install (DIRECTORY examples DESTINATION share/corsika)
 add_subdirectory (tools)
 
 
-
-
-
 #+++++++++++++++++++++++++++++++
 #
 # final summary output
 #
 include (FeatureSummary)
-add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.")
 feature_summary (WHAT ALL)
diff --git a/cmake/corsikaConfig.cmake.in b/cmake/corsikaConfig.cmake.in
index 4bf1338b2ba78645d668e1c1468b537ec566480b..81a499c04bb861e6a660d90bee533b461b30f694 100644
--- a/cmake/corsikaConfig.cmake.in
+++ b/cmake/corsikaConfig.cmake.in
@@ -2,6 +2,30 @@ set (CORSIKA8_VERSION @c8_version@)
 
 @PACKAGE_INIT@
 
+#+++++++++++++++++++++++++++
+# Options
+#
+option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
+
+
+#+++++++++++++++++++++++++++++
+# Build types settings
+#
+# setup coverage build type
+set (CMAKE_CXX_FLAGS_COVERAGE "-g --coverage")
+set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
+set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
+# set a flag to inform code that we are in debug mode
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
+set (ALLOWED_BUILD_TYPES Debug Release MinSizeRel RelWithDebInfo Coverage)
+set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${ALLOWED_BUILD_TYPES})
+set (DEFAULT_BUILD_TYPE "Release")
+if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
+    STRING "Choose the type of build." FORCE)
+endif (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  
+
 #++++++++++++++++++++++++++++
 # General config and flags
 #
@@ -37,3 +61,25 @@ message (STATUS "Pythia8 at: @Pythia8_PREFIX@")
 #     
 include ("${CMAKE_CURRENT_LIST_DIR}/corsikaTargets.cmake")
 check_required_components (corsika)
+
+
+#+++++++++++++++++++++++++++++++
+# add further definitions / options
+#
+if (WITH_HISTORY)
+  set_property (
+    TARGET CORSIKA8::CORSIKA8
+    APPEND PROPERTY
+    INTERFACE_COMPILE_DEFINITIONS "WITH_HISTORY"
+  )
+endif (WITH_HISTORY)
+  
+
+
+#+++++++++++++++++++++++++++++++
+#
+# final summary output
+#
+include (FeatureSummary)
+add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.")
+feature_summary (WHAT ALL)
diff --git a/corsika/setup/SetupStack.hpp b/corsika/setup/SetupStack.hpp
index 6c9696d899be01c7ae4eff98000b5ebe394b293f..847f83834e57d1afa757151df9e92cce7ee8dca4 100644
--- a/corsika/setup/SetupStack.hpp
+++ b/corsika/setup/SetupStack.hpp
@@ -18,12 +18,15 @@ namespace corsika::setup {
 
 #ifdef WITH_HISTORY
 
+#include <corsika/stack/history/HistoryStackExtension.hpp>
+#include <corsika/stack/history/HistorySecondaryProducer.hpp>
+
   /*
    * the version with history
    */
   using Stack = detail::StackWithHistory;
   template <typename T1, template <typename> typename M2>
-  using StackViewProducer = HistorySecondaryProducer<T1, M2>;
+  using StackViewProducer = history::HistorySecondaryProducer<T1, M2>;
 
 #else // WITH_HISTORY
 
@@ -32,7 +35,7 @@ namespace corsika::setup {
    */
   using Stack = detail::StackWithGeometry;
   template <typename T1, template <typename> typename M2>
-  using StackViewProducer = corsika::DefaultSecondaryProducer<T1, M2>;
+  using StackViewProducer = DefaultSecondaryProducer<T1, M2>;
 
 #endif
 
@@ -58,7 +61,7 @@ namespace corsika::setup {
                                   // CHECK with CLANG: setup::Stack::MPIType>;
                                   detail::StackWithHistoryInterface, StackViewProducer>;
 #elif defined(__GNUC__) || defined(__GNUG__)
-  using StackView = make_view<setup::Stack, StackViewProducer>::type;
+  using StackView = MakeView<setup::Stack, StackViewProducer>::type;
 #endif
 
 #else // WITH_HISTORY
@@ -69,7 +72,7 @@ namespace corsika::setup {
                                   // setup::Stack::MPIType>;
                                   setup::detail::StackWithGeometryInterface>;
 #elif defined(__GNUC__) || defined(__GNUG__)
-  using StackView = corsika::MakeView<setup::Stack>::type;
+  using StackView = MakeView<setup::Stack>::type;
 #endif
 
 #endif // WITH_HISTORY