diff --git a/dumux/assembly/staggeredlocalassembler.hh b/dumux/assembly/staggeredlocalassembler.hh
index 0204b48813d5da985b79a1681d3727b35af0dd04..aa29b43c63cdc11edddada19c78f7b955c1993c2 100644
--- a/dumux/assembly/staggeredlocalassembler.hh
+++ b/dumux/assembly/staggeredlocalassembler.hh
@@ -88,7 +88,7 @@ class StaggeredLocalAssembler<TypeTag,
     using FaceSolutionVector = typename GET_PROP_TYPE(TypeTag, FaceSolutionVector);
     using FaceSolution = typename GET_PROP_TYPE(TypeTag, StaggeredFaceSolution);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
@@ -97,7 +97,6 @@ class StaggeredLocalAssembler<TypeTag,
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
 
     static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache);
-    static constexpr auto faceOffset = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
 
 public:
 
@@ -319,37 +318,40 @@ protected:
 
         const auto& connectivityMap = assembler.fvGridGeometry().connectivityMap();
 
-        for(const auto& globalJ : connectivityMap(cellCenterIdx, cellCenterIdx, cellCenterGlobalI))
-        {
-            // get the volVars of the element with respect to which we are going to build the derivative
-            auto&& scvJ = fvGeometry.scv(globalJ);
-            const auto elementJ = fvGeometry.fvGridGeometry().element(globalJ);
-            auto& curVolVars =  getVolVarAccess(gridVariables.curGridVolVars(), curElemVolVars, scvJ);
-            VolumeVariables origVolVars(curVolVars);
-
-            for(auto pvIdx : priVarIndices_(cellCenterIdx))
-            {
-                CellCenterPrimaryVariables priVars(curSol[cellCenterIdx][globalJ]);
-
-                const Scalar eps = numericEpsilon(priVars[pvIdx], cellCenterIdx, cellCenterIdx);
-                priVars[pvIdx] += eps;
-                auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
-                curVolVars.update(elemSol, problem, elementJ, scvJ);
-
-                const auto deflectedResidual = localResidual.evalCellCenter(problem, element, fvGeometry, prevElemVolVars, curElemVolVars,
-                                                                            prevElemFaceVars, curElemFaceVars,
-                                                                            elemBcTypes, elemFluxVarsCache);
-
-                auto partialDeriv = (deflectedResidual - ccResidual);
-                partialDeriv /= eps;
-
-                // update the global jacobian matrix with the current partial derivatives
-                updateGlobalJacobian_(matrix[cellCenterIdx][cellCenterIdx], cellCenterGlobalI, globalJ, pvIdx, partialDeriv);
-
-                // restore the original volVars
-                curVolVars = origVolVars;
-            }
-        }
+       for(const auto& globalJ : connectivityMap(cellCenterIdx, cellCenterIdx, cellCenterGlobalI))
+       {
+           // get the volVars of the element with respect to which we are going to build the derivative
+           auto&& scvJ = fvGeometry.scv(globalJ);
+           const auto elementJ = fvGeometry.fvGridGeometry().element(globalJ);
+           auto& curVolVars =  getVolVarAccess(gridVariables.curGridVolVars(), curElemVolVars, scvJ);
+           VolumeVariables origVolVars(curVolVars);
+
+           for(auto pvIdx : priVarIndices_(cellCenterIdx))
+           {
+               using PrimaryVariables = typename VolumeVariables::PrimaryVariables;
+               const auto& cellCenterPriVars = curSol[cellCenterIdx][globalJ];
+               PrimaryVariables priVars = makePriVarsFromCellCenterPriVars<PrimaryVariables>(cellCenterPriVars);
+
+               constexpr auto offset = PrimaryVariables::dimension - CellCenterPrimaryVariables::dimension;
+               const Scalar eps = numericEpsilon(priVars[pvIdx + offset], cellCenterIdx, cellCenterIdx);
+               priVars[pvIdx + offset] += eps;
+               auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
+               curVolVars.update(elemSol, problem, elementJ, scvJ);
+
+               const auto deflectedResidual = localResidual.evalCellCenter(problem, element, fvGeometry, prevElemVolVars, curElemVolVars,
+                                              prevElemFaceVars, curElemFaceVars,
+                                              elemBcTypes, elemFluxVarsCache);
+
+               auto partialDeriv = (deflectedResidual - ccResidual);
+               partialDeriv /= eps;
+
+               // update the global jacobian matrix with the current partial derivatives
+               updateGlobalJacobian_(matrix[cellCenterIdx][cellCenterIdx], cellCenterGlobalI, globalJ, pvIdx, partialDeriv);
+
+               // restore the original volVars
+               curVolVars = origVolVars;
+           }
+       }
     }
 
     /*!
@@ -369,17 +371,17 @@ protected:
                           JacobianMatrix& matrix,
                           const NumCellCenterEqVector& ccResidual)
     {
-       const auto& problem = assembler.problem();
-       auto& localResidual = assembler.localResidual();
-       auto& gridVariables = assembler.gridVariables();
-       static constexpr auto cellCenterIdx = FVGridGeometry::cellCenterIdx();
-       static constexpr auto faceIdx = FVGridGeometry::faceIdx();
+        const auto& problem = assembler.problem();
+        auto& localResidual = assembler.localResidual();
+        auto& gridVariables = assembler.gridVariables();
+        static constexpr auto cellCenterIdx = FVGridGeometry::cellCenterIdx();
+        static constexpr auto faceIdx = FVGridGeometry::faceIdx();
 
-       // build derivatives with for cell center dofs w.r.t. cell center dofs
-       const auto cellCenterGlobalI = assembler.fvGridGeometry().elementMapper().index(element);
+        // build derivatives with for cell center dofs w.r.t. cell center dofs
+        const auto cellCenterGlobalI = assembler.fvGridGeometry().elementMapper().index(element);
 
-       for(const auto& scvfJ : scvfs(fvGeometry))
-       {
+        for(const auto& scvfJ : scvfs(fvGeometry))
+        {
             const auto globalJ = scvfJ.dofIndex();
 
             // get the faceVars of the face with respect to which we are going to build the derivative
@@ -403,7 +405,7 @@ protected:
                 partialDeriv /= eps;
 
                 // update the global jacobian matrix with the current partial derivatives
-                updateGlobalJacobian_(matrix[cellCenterIdx][faceIdx], cellCenterGlobalI, globalJ, pvIdx - faceOffset, partialDeriv);
+                updateGlobalJacobian_(matrix[cellCenterIdx][faceIdx], cellCenterGlobalI, globalJ, pvIdx, partialDeriv);
 
                 // restore the original faceVars
                 faceVars = origFaceVars;
@@ -451,17 +453,20 @@ protected:
 
                 for(auto pvIdx : priVarIndices_(cellCenterIdx))
                 {
-                    CellCenterPrimaryVariables priVars(curSol[cellCenterIdx][globalJ]);
+                    using PrimaryVariables = typename VolumeVariables::PrimaryVariables;
+                    const auto& cellCenterPriVars = curSol[cellCenterIdx][globalJ];
+                    PrimaryVariables priVars = makePriVarsFromCellCenterPriVars<PrimaryVariables>(cellCenterPriVars);
 
-                    const Scalar eps = numericEpsilon(priVars[pvIdx], faceIdx, cellCenterIdx);
-                    priVars[pvIdx] += eps;
+                    constexpr auto offset = PrimaryVariables::dimension - CellCenterPrimaryVariables::dimension;
+                    const Scalar eps = numericEpsilon(priVars[pvIdx + offset], faceIdx, cellCenterIdx);
+                    priVars[pvIdx + offset] += eps;
                     auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
                     curVolVars.update(elemSol, problem, elementJ, scvJ);
 
                     const auto deflectedResidual = localResidual.evalFace(problem, element, fvGeometry, scvf,
-                                                                          prevElemVolVars, curElemVolVars,
-                                                                          prevElemFaceVars, curElemFaceVars,
-                                                                          elemBcTypes, elemFluxVarsCache);
+                                                   prevElemVolVars, curElemVolVars,
+                                                   prevElemFaceVars, curElemFaceVars,
+                                                   elemBcTypes, elemFluxVarsCache);
 
                     auto partialDeriv = (deflectedResidual - cachedResidual[scvf.localFaceIdx()]);
                     partialDeriv /= eps;
@@ -529,7 +534,7 @@ protected:
                     partialDeriv /= eps;
 
                     // update the global jacobian matrix with the current partial derivatives
-                    updateGlobalJacobian_(matrix[faceIdx][faceIdx], faceGlobalI, globalJ, pvIdx - faceOffset, partialDeriv);
+                    updateGlobalJacobian_(matrix[faceIdx][faceIdx], faceGlobalI, globalJ, pvIdx, partialDeriv);
 
                     // restore the original faceVars
                     faceVars = origFaceVars;
@@ -601,7 +606,6 @@ protected:
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::CellCenterIdx)
     {
         constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
-
 #if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Dune::range(0, numEqCellCenter);
 #else
@@ -613,12 +617,11 @@ protected:
     //! Specialization for face dofs.
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::FaceIdx)
     {
-        constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
         constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace);
     #if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
-        return Dune::range(numEqCellCenter, numEqCellCenter + numEqFace);
+        return Dune::range(0, numEqFace);
     #else
-        return IntRange(numEqCellCenter, numEqCellCenter + numEqFace);
+        return IntRange(0, numEqFace);
     #endif
     }
 
diff --git a/dumux/common/dimensionlessnumbers.hh b/dumux/common/dimensionlessnumbers.hh
index 8efc0366da73dc5da3133433fb98a042160b3baa..6dfec8855bf3c55f5475d73f467856f4a6844cf8 100644
--- a/dumux/common/dimensionlessnumbers.hh
+++ b/dumux/common/dimensionlessnumbers.hh
@@ -28,11 +28,30 @@
 #define DIMENSIONLESS_NUMBERS_HH
 
 #include <cmath>
+#include <iostream>
 
 #include <dune/common/exceptions.hh>
 
 namespace Dumux {
 
+/*!
+ * \brief A container for possible values of the property for selecting which nusselt parametrization to choose.
+ *        The actual value is set vie the property NusseltFormulation
+ */
+enum class NusseltFormulation
+{
+    dittusBoelter, WakaoKaguei, VDI
+};
+
+/*!
+ * \brief A container for possible values of the property for selecting which sherwood parametrization to choose.
+ *        The actual value is set vie the property SherwoodFormulation
+ */
+enum class SherwoodFormulation
+{
+    WakaoKaguei
+};
+
 /*!
  * \brief Collection of functions which calculate dimensionless numbers.
  * \ingroup Common
@@ -102,17 +121,6 @@ static Scalar prandtlNumber(const Scalar dynamicViscosity,
     return dynamicViscosity * heatCapacity / thermalConductivity;
 }
 
-/*!
- * \brief A container for possible values of the property for selecting which nusselt parametrization to choose.
- *        The actual value is set vie the property NusseltFormulation
- */
-struct NusseltFormulation
-{
-    static const int dittusBoelter = 0;
-    static const int WakaoKaguei = 1;
-    static const int VDI = 2;
-};
-
 /*!
  * \brief   Calculate the Nusselt Number [-] (Nu).
  *
@@ -142,7 +150,7 @@ struct NusseltFormulation
 static Scalar nusseltNumberForced(const Scalar reynoldsNumber,
                                   const Scalar prandtlNumber,
                                   const Scalar porosity,
-                                  const int formulation )
+                                  NusseltFormulation formulation)
 {
     if (formulation == NusseltFormulation::dittusBoelter){
        /* example: very common and simple case: flow straight circular pipe, only convection (no boiling),
@@ -218,15 +226,6 @@ static Scalar schmidtNumber(const Scalar dynamicViscosity,
     return dynamicViscosity  / (massDensity * diffusionCoefficient);
 }
 
-/*!
- * \brief A container for possible values of the property for selecting which sherwood parametrization to choose.
- *        The actual value is set vie the property SherwoodFormulation
- */
-struct SherwoodFormulation
-{
-    static const int WakaoKaguei = 0;
-};
-
 /*!
  * \brief   Calculate the Sherwood Number [-] (Sh).
  *
@@ -258,7 +257,7 @@ struct SherwoodFormulation
 
 static Scalar sherwoodNumber(const Scalar reynoldsNumber,
                              const Scalar schmidtNumber,
-                             const int formulation)
+                             SherwoodFormulation formulation)
 {
     if (formulation == SherwoodFormulation::WakaoKaguei){
         /* example: flow through porous medium *single phase*
diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh
index 9c2b7bf1bc0e900a451b6be64616b50438af3c88..aee63d335e022d3bfee25089bbc6b30891132c7c 100644
--- a/dumux/common/properties.hh
+++ b/dumux/common/properties.hh
@@ -42,7 +42,6 @@ NEW_PROP_TAG(ModelParameterGroup);    //!< Property which defines the group that
 NEW_PROP_TAG(ModelDefaultParameters); //!< Property which defines the group that is queried for parameters by default
 NEW_PROP_TAG(GridCreator);            //!< Property which provides a GridCreator (manages grids)
 NEW_PROP_TAG(Grid);                   //!< The DUNE grid type
-NEW_PROP_TAG(Indices);                //!< Enumerations for the numeric model
 NEW_PROP_TAG(PrimaryVariables);       //!< A vector of primary variables
 NEW_PROP_TAG(NumEqVector);            //!< A vector of size number equations that can be used for Neumann fluxes, sources, residuals, ...
 NEW_PROP_TAG(GridView);               //!< The type of the grid view according to the grid type
@@ -129,8 +128,7 @@ NEW_PROP_TAG(EvaluatePermeabilityAtScvfIP);
 // Additional properties used by the 2pnc and 2pncmin models:
 //////////////////////////////////////////////////////////////
 NEW_PROP_TAG(Chemistry);                           //!< The chemistry class with which solves equlibrium reactions
-NEW_PROP_TAG(NumMajorComponents);                  //!< Number of major fluid components which are considered in the calculation of the phase density
-NEW_PROP_TAG(SetMoleFractionsForWettingPhase);     //!< Set the mole fraction in the wetting or non-wetting phase
+NEW_PROP_TAG(SetMoleFractionsForFirstPhase);       //!< Set the mole fraction in the wetting or non-wetting phase
 
 //////////////////////////////////////////////////////////////
 // Additional properties used by the richards model
diff --git a/dumux/common/staggeredfvproblem.hh b/dumux/common/staggeredfvproblem.hh
index 8f6acc9e8ba347a35f22e0b941ce6c6725683b9b..e6f431336d9d6a8f0658565126104fb73e42e8cc 100644
--- a/dumux/common/staggeredfvproblem.hh
+++ b/dumux/common/staggeredfvproblem.hh
@@ -135,8 +135,12 @@ public:
                                          const SubControlVolume& scv,
                                          const PrimaryVariables& initSol) const
     {
+        constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
+        constexpr auto numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
+        constexpr auto offset = numEq - numEqCellCenter;
+
         for(auto&& i : priVarIndices_(cellCenterIdx))
-            sol[cellCenterIdx][scv.dofIndex()][i] = initSol[i];
+            sol[cellCenterIdx][scv.dofIndex()][i] = initSol[i + offset];
     }
 
     //! Applys the initial face solution
@@ -162,7 +166,6 @@ protected:
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::CellCenterIdx)
     {
         constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
-
 #if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Dune::range(0, numEqCellCenter);
 #else
@@ -174,12 +177,11 @@ protected:
     //! Specialization for face dofs.
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::FaceIdx)
     {
-        constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
-        constexpr auto numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
+        constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace);
 #if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
-        return Dune::range(numEqCellCenter, numEq);
+        return Dune::range(0, numEqFace);
 #else
-        return IntRange(numEqCellCenter, numEq);
+        return IntRange(0, numEqFace);
 #endif
     }
 
diff --git a/dumux/discretization/CMakeLists.txt b/dumux/discretization/CMakeLists.txt
index b1a9c0506d054d2a397425202257ef24225f4463..1fd9c81445e12a78b76930736f83d369c28113b1 100644
--- a/dumux/discretization/CMakeLists.txt
+++ b/dumux/discretization/CMakeLists.txt
@@ -21,5 +21,4 @@ stationaryvelocityfield.hh
 subcontrolvolumebase.hh
 subcontrolvolumefacebase.hh
 upwindscheme.hh
-volumevariables.hh
 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/discretization)
diff --git a/dumux/discretization/box/fickslaw.hh b/dumux/discretization/box/fickslaw.hh
index 2c888f7aaaabfe36181b67d2724509db44433fe1..34b2e7add035f472b2521b4e68fb030dc2ae921e 100644
--- a/dumux/discretization/box/fickslaw.hh
+++ b/dumux/discretization/box/fickslaw.hh
@@ -54,16 +54,17 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::box>
     using FluxVarCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache);
     using BalanceEqOpts = typename GET_PROP_TYPE(TypeTag, BalanceEqOpts);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using Element = typename GridView::template Codim<0>::Entity;
+    using IndexType = typename GridView::IndexSet::IndexType;
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
     enum { dim = GridView::dimension} ;
     enum { dimWorld = GridView::dimensionworld} ;
     enum
     {
-        numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
-        numComponents =  GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()
+        numPhases = ModelTraits::numPhases(),
+        numComponents = ModelTraits::numComponents()
     };
     using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
diff --git a/dumux/discretization/box/maxwellstefanslaw.hh b/dumux/discretization/box/maxwellstefanslaw.hh
index 8791b3f64c99e1b00407276c5df153abecdf882d..b0f61b7a7d5f2109f567ce13b4aed8f06b99d740 100644
--- a/dumux/discretization/box/maxwellstefanslaw.hh
+++ b/dumux/discretization/box/maxwellstefanslaw.hh
@@ -57,7 +57,7 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::box >
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using IndexType = typename GridView::IndexSet::IndexType;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using Element = typename GridView::template Codim<0>::Entity;
 
     enum { dim = GridView::dimension} ;
diff --git a/dumux/discretization/cellcentered/elementsolution.hh b/dumux/discretization/cellcentered/elementsolution.hh
index e69991f8d3d337ab0afbf4cf3864d0a1c17a9377..2797eba3baa9e216ff87483d7d3ed398fe9ca35f 100644
--- a/dumux/discretization/cellcentered/elementsolution.hh
+++ b/dumux/discretization/cellcentered/elementsolution.hh
@@ -145,6 +145,20 @@ auto elementSolution(PrimaryVariables&& priVars)
     return CCElementSolution<FVElementGeometry, PrimaryVariables>(std::move(priVars));
 }
 
+/*!
+ * \ingroup CCDiscretization
+ * \brief  Make an element solution for cell-centered schemes
+ * \note This is e.g. used to contruct an element solution at Dirichlet boundaries
+ */
+template<class FVElementGeometry, class PrimaryVariables>
+auto elementSolution(const PrimaryVariables& priVars)
+-> std::enable_if_t<FVElementGeometry::FVGridGeometry::discMethod == DiscretizationMethod::cctpfa ||
+                    FVElementGeometry::FVGridGeometry::discMethod == DiscretizationMethod::ccmpfa,
+                    CCElementSolution<FVElementGeometry, PrimaryVariables>>
+{
+    return CCElementSolution<FVElementGeometry, PrimaryVariables>(priVars);
+}
+
 } // end namespace Dumux
 
 #endif
diff --git a/dumux/discretization/cellcentered/tpfa/fickslaw.hh b/dumux/discretization/cellcentered/tpfa/fickslaw.hh
index d8451a589b963357e47514e911e09b77cf3348d5..dd8bd863008bb7b9d732174b88a6087639de3068 100644
--- a/dumux/discretization/cellcentered/tpfa/fickslaw.hh
+++ b/dumux/discretization/cellcentered/tpfa/fickslaw.hh
@@ -58,12 +58,14 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa>
     using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BalanceEqOpts = typename GET_PROP_TYPE(TypeTag, BalanceEqOpts);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
     static const int dim = GridView::dimension;
     static const int dimWorld = GridView::dimensionworld;
-    static const int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases();
-    static const int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents();
+    static const int numPhases = ModelTraits::numPhases();
+    static const int numComponents = ModelTraits::numComponents();
 
     using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
diff --git a/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh b/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh
index 3fdfefc16ff86e2e6c601b830266e688b1a8603e..c3be43c7eae2426360b36b8747466a4d8c748d91 100644
--- a/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh
+++ b/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh
@@ -58,7 +58,7 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::cctpfa >
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
     using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     static const int dim = GridView::dimension;
diff --git a/dumux/discretization/fvgridvariables.hh b/dumux/discretization/fvgridvariables.hh
index cda91b42673ba74314c0fbc4ab2021c5659f49e5..f606089e3210fcb93d928bde931a3e3f435e9dca 100644
--- a/dumux/discretization/fvgridvariables.hh
+++ b/dumux/discretization/fvgridvariables.hh
@@ -24,6 +24,7 @@
 #ifndef DUMUX_FV_GRID_VARIABLES_HH
 #define DUMUX_FV_GRID_VARIABLES_HH
 
+#include <type_traits>
 #include <memory>
 
 namespace Dumux {
@@ -35,13 +36,31 @@ namespace Dumux {
  * \tparam the type of the grid volume variables
  * \tparam the type of the grid flux variables cache
  */
-template<class FVGridGeometry, class GridVolumeVariables, class GridFluxVariablesCache>
+template<class GG, class GVV, class GFVC>
 class FVGridVariables
 {
 public:
+    //! export type of the finite volume grid geometry
+    using GridGeometry = GG;
+
+    //! export type of the finite volume grid geometry
+    using GridVolumeVariables = GVV;
+
+    //! export type of the volume variables
+    using VolumeVariables = typename GridVolumeVariables::VolumeVariables;
+
+    //! export primary variable type
+    using PrimaryVariables = typename VolumeVariables::PrimaryVariables;
+
+    //! export scalar type (TODO get it directly from the volvars)
+    using Scalar = std::decay_t<decltype(std::declval<PrimaryVariables>()[0])>;
+
+    //! export type of the finite volume grid geometry
+    using GridFluxVariablesCache = GFVC;
+
     template<class Problem>
     FVGridVariables(std::shared_ptr<Problem> problem,
-                    std::shared_ptr<FVGridGeometry> fvGridGeometry)
+                    std::shared_ptr<GridGeometry> fvGridGeometry)
     : fvGridGeometry_(fvGridGeometry)
     , curGridVolVars_(*problem)
     , prevGridVolVars_(*problem)
@@ -130,7 +149,7 @@ public:
 
 protected:
 
-    std::shared_ptr<const FVGridGeometry> fvGridGeometry_; //!< pointer to the constant grid geometry
+    std::shared_ptr<const GridGeometry> fvGridGeometry_; //!< pointer to the constant grid geometry
 
 private:
     GridVolumeVariables curGridVolVars_; //!< the current volume variables (primary and secondary variables)
diff --git a/dumux/discretization/staggered/elementsolution.hh b/dumux/discretization/staggered/elementsolution.hh
index bbf02febef3db8ee0ee433a5062e71e33e0ceddd..06a9482c07a0bb1cea58a8d990f150e40566bd9c 100644
--- a/dumux/discretization/staggered/elementsolution.hh
+++ b/dumux/discretization/staggered/elementsolution.hh
@@ -30,6 +30,26 @@
 
 namespace Dumux {
 
+/*!
+ * \ingroup StaggeredDiscretization
+ * \brief  Helper function to creater a PrimaryVariables object from CellCenterPrimaryVariables
+ * \tparam PrimaryVariables The type of the desired primary variables object
+ * \tparam CellCenterPrimaryVariables The type of the cell center (input) primary variables object
+ * \param CellCenterPrimaryVariables The cell center (input) primary variables object
+ */
+template<class PrimaryVariables, class CellCenterPrimaryVariables>
+PrimaryVariables makePriVarsFromCellCenterPriVars(const CellCenterPrimaryVariables& cellCenterPriVars)
+{
+    static_assert(int(PrimaryVariables::dimension) > int(CellCenterPrimaryVariables::dimension),
+                  "PrimaryVariables' size must be greater than the one of CellCenterPrimaryVariables");
+
+    PrimaryVariables priVars(0.0);
+    constexpr auto offset = PrimaryVariables::dimension - CellCenterPrimaryVariables::dimension;
+    for (std::size_t i = 0; i < cellCenterPriVars.size(); ++i)
+        priVars[i + offset] = cellCenterPriVars[i];
+    return priVars;
+}
+
 template<class PrimaryVariables>
 using StaggeredElementSolution = Dune::BlockVector<PrimaryVariables>;
 
diff --git a/dumux/discretization/staggered/freeflow/boundarytypes.hh b/dumux/discretization/staggered/freeflow/boundarytypes.hh
index 6cb1a8bbf813748a66ab5a46b51e176475ccd9f0..e521a3b0a47e9aaf82f4bbde69b83af74584c6b2 100644
--- a/dumux/discretization/staggered/freeflow/boundarytypes.hh
+++ b/dumux/discretization/staggered/freeflow/boundarytypes.hh
@@ -47,7 +47,6 @@ public:
             resetEq(eqIdx);
     }
 
-
     /*!
      * \brief Reset the boundary types for one equation.
      */
diff --git a/dumux/discretization/staggered/freeflow/fickslaw.hh b/dumux/discretization/staggered/freeflow/fickslaw.hh
index 58dedfe952338f94f1f99cd37e7785bb074727a5..756bda9671c81fca738370a02d924e6591167f24 100644
--- a/dumux/discretization/staggered/freeflow/fickslaw.hh
+++ b/dumux/discretization/staggered/freeflow/fickslaw.hh
@@ -54,7 +54,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered >
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     static constexpr int dim = GridView::dimension;
@@ -106,7 +106,7 @@ public:
             if(scvf.boundary())
             {
                 const auto bcTypes = problem.boundaryTypesAtPos(scvf.center());
-                if(bcTypes.isOutflow(eqIdx) && eqIdx != pressureIdx)
+                if(bcTypes.isOutflow(eqIdx))
                     return flux;
             }
 
diff --git a/dumux/discretization/staggered/freeflow/fourierslaw.hh b/dumux/discretization/staggered/freeflow/fourierslaw.hh
index f6ad42bdac90d55f053f582ce94585aef64fbab9..c812bba154b8264832f98729e7f5f2524eafbfc9 100644
--- a/dumux/discretization/staggered/freeflow/fourierslaw.hh
+++ b/dumux/discretization/staggered/freeflow/fourierslaw.hh
@@ -51,7 +51,7 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::staggered >
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using Element = typename GridView::template Codim<0>::Entity;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum { energyBalanceIdx = Indices::energyBalanceIdx };
 
diff --git a/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh b/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh
index 843c7dfaddd1b97785ebf028ed3c5ea9d6f5749e..a826694421ec029c808652a2e8110b04d0206874 100644
--- a/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh
+++ b/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh
@@ -54,7 +54,7 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::staggered >
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     static const int dim = GridView::dimension;
diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh
index 62a44bbac91317bc3621f889c8a708b54f3c8873..7d8d20f15c38a6815b73da380aecd5bf705a7073 100644
--- a/dumux/discretization/staggered/freeflow/properties.hh
+++ b/dumux/discretization/staggered/freeflow/properties.hh
@@ -97,10 +97,7 @@ public:
 //! Boundary types at a single degree of freedom
 SET_PROP(StaggeredFreeFlowModel, BoundaryTypes)
 {
-private:
-    static constexpr auto size = GET_PROP_VALUE(TypeTag, NumEqCellCenter) + GET_PROP_VALUE(TypeTag, NumEqFace);
-public:
-    using type = StaggeredFreeFlowBoundaryTypes<size>;
+    using type = StaggeredFreeFlowBoundaryTypes<GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>;
 };
 
 //! The velocity output
diff --git a/dumux/discretization/staggered/gridvolumevariables.hh b/dumux/discretization/staggered/gridvolumevariables.hh
index d1f2716aed0e1a9a32368c9ba09eb3fc73abf618..0f2fbd7b26181ad308bf2f93a84cd81740ccd302 100644
--- a/dumux/discretization/staggered/gridvolumevariables.hh
+++ b/dumux/discretization/staggered/gridvolumevariables.hh
@@ -49,6 +49,7 @@ class StaggeredGridVolumeVariables<Traits, /*cachingEnabled*/true>
 {
     using ThisType = StaggeredGridVolumeVariables<Traits, true>;
     using Problem = typename Traits::Problem;
+    using PrimaryVariables = typename Traits::VolumeVariables::PrimaryVariables;
 
 public:
     //! export the type of the indices TODO: get them out of the volvars
@@ -81,7 +82,10 @@ public:
 
             for (auto&& scv : scvs(fvGeometry))
             {
-                CellCenterPrimaryVariables priVars = sol[scv.dofIndex()];
+                // construct a privars object from the cell center solution vector
+                const auto& cellCenterPriVars = sol[scv.dofIndex()];
+                PrimaryVariables priVars = makePriVarsFromCellCenterPriVars<PrimaryVariables>(cellCenterPriVars);
+
                 auto elemSol = elementSolution<typename FVGridGeometry::LocalView>(std::move(priVars));
                 volumeVariables_[scv.dofIndex()].update(elemSol, problem(), element, scv);
             }
@@ -97,14 +101,14 @@ public:
                 const auto insideScvIdx = scvf.insideScvIdx();
                 const auto& insideScv = fvGeometry.scv(insideScvIdx);
 
-                CellCenterPrimaryVariables boundaryPriVars(0.0);
-
-                for(int eqIdx = 0; eqIdx < CellCenterPrimaryVariables::dimension; ++eqIdx)
+                PrimaryVariables boundaryPriVars(0.0);
+                constexpr auto offset = PrimaryVariables::dimension - CellCenterPrimaryVariables::dimension;
+                for(int eqIdx = offset; eqIdx < PrimaryVariables::dimension; ++eqIdx)
                 {
                     if(bcTypes.isDirichlet(eqIdx) || bcTypes.isDirichletCell(eqIdx))
                         boundaryPriVars[eqIdx] = problem().dirichlet(element, scvf)[eqIdx];
                     else if(bcTypes.isNeumann(eqIdx) || bcTypes.isOutflow(eqIdx) || bcTypes.isSymmetry())
-                        boundaryPriVars[eqIdx] = sol[scvf.insideScvIdx()][eqIdx];
+                        boundaryPriVars[eqIdx] = sol[scvf.insideScvIdx()][eqIdx - offset];
                     //TODO: this assumes a zero-gradient for e.g. the pressure on the boundary
                     // could be made more general by allowing a non-zero-gradient, provided in problem file
                     else
diff --git a/dumux/discretization/staggered/properties.hh b/dumux/discretization/staggered/properties.hh
index a05602903685c4e909563823af82775d1b5ffa2c..7a383c383053eaeb9799bb64fb0901e64829513d 100644
--- a/dumux/discretization/staggered/properties.hh
+++ b/dumux/discretization/staggered/properties.hh
@@ -81,7 +81,7 @@ private:
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices); // TODO extract indices from volumevariables
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; // TODO extract indices from volumevariables
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
     static constexpr auto enableCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache);
@@ -135,6 +135,7 @@ SET_TYPE_PROP(StaggeredModel,
               CellCenterPrimaryVariables,
               Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar),
                                 GET_PROP_VALUE(TypeTag, NumEqCellCenter)>);
+
 //! The face primary variables
 SET_TYPE_PROP(StaggeredModel,
               FacePrimaryVariables,
@@ -142,14 +143,7 @@ SET_TYPE_PROP(StaggeredModel,
                                 GET_PROP_VALUE(TypeTag, NumEqFace)>);
 
 //! Boundary types at a single degree of freedom
-SET_PROP(StaggeredModel, BoundaryTypes)
-{
-private:
-    static constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
-    static constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace);
-public:
-    using type = BoundaryTypes<numEqCellCenter + numEqFace>;
-};
+SET_TYPE_PROP(StaggeredModel, BoundaryTypes, BoundaryTypes<GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>);
 
 //! Set one or different base epsilons for the calculations of the localJacobian's derivatives
 SET_PROP(StaggeredModel, BaseEpsilon)
diff --git a/dumux/freeflow/navierstokes/indices.hh b/dumux/freeflow/navierstokes/indices.hh
index ce938fee66d3b78e21caf7dce89f08f285d6ff8b..13cd017e69c08493b2edccad20f9157a44b500d9 100644
--- a/dumux/freeflow/navierstokes/indices.hh
+++ b/dumux/freeflow/navierstokes/indices.hh
@@ -24,42 +24,33 @@
 #ifndef DUMUX_NAVIERSTOKES_INDICES_HH
 #define DUMUX_NAVIERSTOKES_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
 namespace Dumux {
 
-// \{
 /*!
  * \ingroup NavierStokesModel
  * \brief The common indices for the isothermal Navier-Stokes model.
  *
  * \tparam dimension The dimension of the problem
- * \tparam numEquations the number of model equations
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <int dimension, int numEquations, int PVOffset = 0>
+template <int dimension>
 struct NavierStokesIndices
 {
-
     static constexpr int dimXIdx = 0; //!< Index of the x-component of a vector of size dim
     static constexpr int dimYIdx = 1; //!< Index of the y-component of a vector of size dim
     static constexpr int dimZIdx = 2; //!< Index of the z-component of a vector of size dim
 
-    static constexpr int totalMassBalanceIdx = PVOffset + 0; //!< Index of the total mass balance equation
-    static constexpr int pressureIdx = totalMassBalanceIdx; //!< Index of the pressure in a solution vector
+    static constexpr int conti0EqIdx = dimension; //!< Index of the total mass balance equation
+    static constexpr int pressureIdx = conti0EqIdx; //!< Index of the pressure in a solution vector
 
     static constexpr auto dim = dimension;
-    static constexpr auto numEq = numEquations;
-    static constexpr auto momentumBalanceOffset = numEquations - dim;
 
-    static constexpr int momentumBalanceIdx = PVOffset + momentumBalanceOffset; //!< Index of the momentum balance equation
-    static constexpr int momentumXBalanceIdx = momentumBalanceIdx; //!< Index of the momentum balance equation
-    static constexpr int momentumYBalanceIdx = momentumBalanceIdx + 1; //!< Index of the momentum balance equation
-    static constexpr int momentumZBalanceIdx = momentumBalanceIdx + 2; //!< Index of the momentum balance equation
+    static constexpr int momentumXBalanceIdx = 0; //!< Index of the momentum balance equation
+    static constexpr int momentumYBalanceIdx = 1; //!< Index of the momentum balance equation
+    static constexpr int momentumZBalanceIdx = 2; //!< Index of the momentum balance equation
 
-    static constexpr int velocityXIdx = momentumBalanceIdx; //!< Index of the velocity in a solution vector
-    static constexpr int velocityYIdx = momentumBalanceIdx + 1; //!< Index of the velocity in a solution vector
-    static constexpr int velocityZIdx = momentumBalanceIdx + 2; //!< Index of the velocity in a solution vector
+    static constexpr int velocityXIdx = 0; //!< Index of the velocity in a solution vector
+    static constexpr int velocityYIdx = 1; //!< Index of the velocity in a solution vector
+    static constexpr int velocityZIdx = 2; //!< Index of the velocity in a solution vector
 
     /*!
      * \brief Index of the velocity in a solution vector given a certain direction.
@@ -68,11 +59,10 @@ struct NavierStokesIndices
      */
     static constexpr int velocity(int dirIdx)
     {
-        return dirIdx + momentumBalanceIdx;
+        return dirIdx;
     }
 };
 
-// \}
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh
index 89fcea54160206255d082cbd709761d77f5cc61b..9af47cb14646c99bc7283343e54021bbc709ee6c 100644
--- a/dumux/freeflow/navierstokes/model.hh
+++ b/dumux/freeflow/navierstokes/model.hh
@@ -65,19 +65,21 @@
 #include <dumux/discretization/methods.hh>
 #include <dumux/discretization/fourierslaw.hh>
 
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup NavierStokesModel
  * \brief Traits for the Navier-Stokes model
  */
-template<int dim>
+template<int dimension>
 struct NavierStokesModelTraits
 {
+    //! The dimension of the model
+    static constexpr int dim() { return dimension; }
+
     //! There are as many momentum balance equations as dimensions
     //! and one mass balance equation.
-    static constexpr int numEq() { return dim+1; }
+    static constexpr int numEq() { return dimension+1; }
 
     //! The number of phases is 1
     static constexpr int numPhases() { return 1; }
@@ -93,6 +95,9 @@ struct NavierStokesModelTraits
 
     //! The model is isothermal
     static constexpr bool enableEnergyBalance() { return false; }
+
+    //! the indices
+    using Indices = NavierStokesIndices<dim()>;
 };
 
 // \{
@@ -154,16 +159,6 @@ SET_TYPE_PROP(NavierStokes, FluxVariables, NavierStokesFluxVariables<TypeTag>);
 //! The flux variables cache class, by default the one for free flow
 SET_TYPE_PROP(NavierStokes, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>);
 
-//! The indices required by the isothermal single-phase model
-SET_PROP(NavierStokes, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension;
-public:
-    using type = NavierStokesIndices<dim, numEq>;
-};
-
 //! The specific vtk output fields
 SET_PROP(NavierStokes, VtkOutputFields)
 {
@@ -187,17 +182,6 @@ public:
     using type = NavierStokesNIModelTraits<IsothermalTraits>;
 };
 
-//! The indices required by the non-isothermal single-phase model
-SET_PROP(NavierStokesNI, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension;
-    using IsothermalIndices = NavierStokesIndices<dim, numEq>;
-public:
-    using type = NavierStokesNonIsothermalIndices<dim, numEq, IsothermalIndices>;
-};
-
 //! The specific non-isothermal vtk output fields
 SET_PROP(NavierStokesNI, VtkOutputFields)
 {
diff --git a/dumux/freeflow/navierstokes/problem.hh b/dumux/freeflow/navierstokes/problem.hh
index 9d987984bdba9240ac40ad3933205145b47de0a3..6d489aec6772ccb7ab3dd715ce81b3ed5e93ede4 100644
--- a/dumux/freeflow/navierstokes/problem.hh
+++ b/dumux/freeflow/navierstokes/problem.hh
@@ -70,7 +70,7 @@ class NavierStokesProblem : public NavierStokesParentProblem<TypeTag>
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum {
         dim = GridView::dimension,
@@ -124,8 +124,7 @@ public:
                               const SubControlVolumeFace& scvf,
                               const PrimaryVariables& initSol) const
     {
-        const auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
-        sol[FVGridGeometry::faceIdx()][scvf.dofIndex()][numEqCellCenter] = initSol[Indices::velocity(scvf.directionIndex())];
+        sol[FVGridGeometry::faceIdx()][scvf.dofIndex()][0] = initSol[Indices::velocity(scvf.directionIndex())];
     }
 
 private:
diff --git a/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh b/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh
index cb1420e263a59d045d949bdfe93fc7aebe3ef82a..497ad18e9be5c58da39fd38d9b094a0bfb8061b3 100644
--- a/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh
+++ b/dumux/freeflow/navierstokes/staggered/fluxoverplane.hh
@@ -55,7 +55,7 @@ class FluxOverPlane
     using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using Element = typename GridView::template Codim<0>::Entity;
 
     enum {
@@ -413,7 +413,7 @@ private:
             }();
 
             CellCenterPrimaryVariables tmp(0.0);
-            tmp[Indices::totalMassBalanceIdx] = cumulativeFlux / avgDensity;
+            tmp[0] = cumulativeFlux / avgDensity;
             return tmp;
         };
 
@@ -435,8 +435,7 @@ private:
                                const auto& elemFluxVarsCache)
         {
             const Scalar totalMassFlux = localResidual_.computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars,
-                                                                                 elemFaceVars, scvf, elemFluxVarsCache)
-                                                                                [Indices::totalMassBalanceIdx];
+                                                                                 elemFaceVars, scvf, elemFluxVarsCache)[0];
 
             const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
             const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
@@ -444,7 +443,7 @@ private:
             const auto avgDensity = 0.5*insideVolVars.density() + 0.5*outsideVolVars.density();
 
             CellCenterPrimaryVariables tmp(0.0);
-            tmp[Indices::totalMassBalanceIdx] = totalMassFlux / avgDensity;
+            tmp[0] = totalMassFlux / avgDensity;
             return tmp;
         };
 
diff --git a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh
index 5caa3d675b335d92d254ed5e3ebc2629e1636e45..996bf049b2e75d090287fc194c2d2cfb5f007f45 100644
--- a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh
+++ b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh
@@ -67,7 +67,8 @@ class NavierStokesFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered>
     using GridView = typename FVGridGeometry::GridView;
     using Element = typename GridView::template Codim<0>::Entity;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
     using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
@@ -142,14 +143,14 @@ public:
 
         // Check if we are on an outflow boundary.
         const bool isOutflow = scvf.boundary()
-                               ? problem.boundaryTypesAtPos(scvf.center()).isOutflow(Indices::totalMassBalanceIdx)
+                               ? problem.boundaryTypesAtPos(scvf.center()).isOutflow(Indices::conti0EqIdx)
                                : false;
 
         // Call the generic flux function.
         const Scalar flux = advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow);
 
         CellCenterPrimaryVariables result(0.0);
-        result[Indices::totalMassBalanceIdx] = flux;
+        result[Indices::conti0EqIdx - ModelTraits::dim()] = flux;
 
         return result;
     }
@@ -249,7 +250,7 @@ public:
         // Treat outflow conditions.
         if(scvf.boundary())
         {
-            if(problem.boundaryTypesAtPos(scvf.center()).isOutflow(Indices::momentumBalanceIdx))
+            if(problem.boundaryTypesAtPos(scvf.center()).isOutflow(Indices::velocity(scvf.directionIndex())))
             {
                 // Treat the staggered half-volume adjacent to the boundary as if it was on the opposite side of the boundary.
                 // The respective face's outer normal vector will point in the same direction as the scvf's one.
diff --git a/dumux/freeflow/navierstokes/staggered/localresidual.hh b/dumux/freeflow/navierstokes/staggered/localresidual.hh
index c0155ee5154cb3534e4eecce51d24ac7073d2258..eded3063985b0eab43f51931fa001edc2426a2e1 100644
--- a/dumux/freeflow/navierstokes/staggered/localresidual.hh
+++ b/dumux/freeflow/navierstokes/staggered/localresidual.hh
@@ -71,7 +71,7 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethod::staggered>
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
     using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using CellCenterResidual = CellCenterPrimaryVariables;
     using FaceResidual = FacePrimaryVariables;
@@ -80,6 +80,10 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethod::staggered>
 
 public:
 
+    // account for the offset of the cell center privars within the PrimaryVariables container
+    static constexpr auto cellCenterOffset = ModelTraits::numEq() - CellCenterPrimaryVariables::dimension;
+    static_assert(cellCenterOffset == ModelTraits::dim(), "cellCenterOffset must equal dim for staggered NavierStokes");
+
     //! Use the parent type's constructor
     using ParentType::ParentType;
 
@@ -116,7 +120,8 @@ public:
         const auto sourceValues = problem.sourceAtPos(scv.center());
 
         // copy the respective cell center related values to the result
-        std::copy_n(sourceValues.begin(), result.size(), result.begin());
+        for (int i = 0; i < result.size(); ++i)
+            result[i] = sourceValues[i + cellCenterOffset];
 
         return result;
     }
@@ -128,7 +133,7 @@ public:
                                                            const VolumeVariables& volVars) const
     {
         CellCenterPrimaryVariables storage;
-        storage[Indices::totalMassBalanceIdx] = volVars.density();
+        storage[Indices::conti0EqIdx - ModelTraits::dim()] = volVars.density();
 
         computeStorageForCellCenterNonIsothermal_(std::integral_constant<bool, ModelTraits::enableEnergyBalance() >(),
                                                   problem, scv, volVars, storage);
@@ -224,12 +229,14 @@ protected:
                     static constexpr auto numEqCellCenter = CellCenterResidual::dimension;
                     // handle Neumann BCs, i.e. overwrite certain fluxes by user-specified values
                     for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx)
-                        if(bcTypes.isNeumann(eqIdx))
+                    {
+                        if(bcTypes.isNeumann(eqIdx + cellCenterOffset))
                         {
                             const auto extrusionFactor = 1.0; //TODO: get correct extrusion factor
-                            boundaryFlux[eqIdx] = problem.neumann(element, fvGeometry, elemVolVars, scvf)[eqIdx]
-                                                   * extrusionFactor * scvf.area();
+                            boundaryFlux[eqIdx] = problem.neumann(element, fvGeometry, elemVolVars, scvf)[eqIdx + cellCenterOffset]
+                                                  * extrusionFactor * scvf.area();
                         }
+                    }
                 }
 
                 residual += boundaryFlux;
@@ -251,10 +258,10 @@ protected:
                        const BoundaryTypes& bcTypes) const
     {
         // set a fixed pressure for cells adjacent to a wall
-        if(bcTypes.isDirichletCell(Indices::totalMassBalanceIdx))
+        if(bcTypes.isDirichletCell(Indices::conti0EqIdx))
         {
             const auto& insideVolVars = elemVolVars[insideScv];
-            residual[Indices::pressureIdx] = insideVolVars.pressure() - problem.dirichletAtPos(insideScv.center())[Indices::pressureIdx];
+            residual[Indices::conti0EqIdx - cellCenterOffset] = insideVolVars.pressure() - problem.dirichletAtPos(insideScv.center())[Indices::pressureIdx];
         }
     }
 
@@ -278,7 +285,7 @@ protected:
             const auto bcTypes = problem.boundaryTypes(element, scvf);
 
             // set a fixed value for the velocity for Dirichlet boundary conditions
-            if(bcTypes.isDirichlet(Indices::momentumBalanceIdx))
+            if(bcTypes.isDirichlet(Indices::velocity(scvf.directionIndex())))
             {
                 const Scalar velocity = elementFaceVars[scvf].velocitySelf();
                 const Scalar dirichletValue = problem.dirichlet(element, scvf)[Indices::velocity(scvf.directionIndex())];
@@ -296,9 +303,9 @@ protected:
             }
 
             // outflow condition for the momentum balance equation
-            if(bcTypes.isOutflow(Indices::momentumBalanceIdx))
+            if(bcTypes.isOutflow(Indices::velocity(scvf.directionIndex())))
             {
-                if(bcTypes.isDirichlet(Indices::totalMassBalanceIdx))
+                if(bcTypes.isDirichlet(Indices::conti0EqIdx))
                     residual += computeFluxForFace(problem, element, scvf, fvGeometry, elemVolVars, elementFaceVars, elemFluxVarsCache);
                 else
                     DUNE_THROW(Dune::InvalidStateException, "Face at " << scvf.center()  << " has an outflow BC for the momentum balance but no Dirichlet BC for the pressure!");
@@ -330,8 +337,8 @@ protected:
         auto upwindTerm = [](const auto& volVars) { return volVars.density() * volVars.enthalpy(); };
         using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType);
 
-        flux[Indices::energyBalanceIdx] = FluxVariables::advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow);
-        flux[Indices::energyBalanceIdx] += HeatConductionType::diffusiveFluxForCellCenter(problem, element, fvGeometry, elemVolVars, scvf);
+        flux[Indices::energyBalanceIdx - cellCenterOffset] = FluxVariables::advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow);
+        flux[Indices::energyBalanceIdx - cellCenterOffset] += HeatConductionType::diffusiveFluxForCellCenter(problem, element, fvGeometry, elemVolVars, scvf);
     }
 
     //! Evaluate energy fluxes entering or leaving the cell center control volume for non isothermal models
@@ -345,7 +352,7 @@ protected:
                                                    const VolumeVariables& volVars,
                                                    CellCenterPrimaryVariables& storage) const
     {
-        storage[Indices::energyBalanceIdx] = volVars.density() * volVars.internalEnergy();
+        storage[Indices::energyBalanceIdx - cellCenterOffset] = volVars.density() * volVars.internalEnergy();
     }
 
     //! Evaluate energy storage for isothermal models
@@ -362,6 +369,7 @@ private:
     const Implementation &asImp_() const
     { return *static_cast<const Implementation *>(this); }
 };
-}
+
+} // end namespace Dumux
 
 #endif   // DUMUX_STAGGERED_NAVIERSTOKES_LOCAL_RESIDUAL_HH
diff --git a/dumux/freeflow/navierstokes/volumevariables.hh b/dumux/freeflow/navierstokes/volumevariables.hh
index 862285c1d69e1c5412f03dd4bdabb0e6d2c4fc6c..cf39b841b43c5659814ccf2bcb07251bb269aa91 100644
--- a/dumux/freeflow/navierstokes/volumevariables.hh
+++ b/dumux/freeflow/navierstokes/volumevariables.hh
@@ -50,13 +50,14 @@ template <class TypeTag>
 class NavierStokesVolumeVariablesImplementation<TypeTag, false>
 {
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     static const int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
 
 public:
-
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
 
     /*!
@@ -225,15 +226,16 @@ class NavierStokesVolumeVariablesImplementation<TypeTag, true>
 {
     using ParentType = NavierStokesVolumeVariablesImplementation<TypeTag, false>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     static const int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
     static const int temperatureIdx = Indices::temperatureIdx;
 
 public:
-
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using PrimaryVariables = typename ParentType::PrimaryVariables;
+    using FluidSystem = typename ParentType::FluidSystem;
+    using FluidState = typename ParentType::FluidState;
 
     /*!
      * \brief Update all quantities for a given control volume
diff --git a/dumux/freeflow/navierstokesnc/indices.hh b/dumux/freeflow/navierstokesnc/indices.hh
index a7bcf0211d18664fda35ca9b620a10828deff295..dfaa51033636df17d4caf8136f1f5707bfde9505 100644
--- a/dumux/freeflow/navierstokesnc/indices.hh
+++ b/dumux/freeflow/navierstokesnc/indices.hh
@@ -25,37 +25,25 @@
 #define DUMUX_STAGGERED_NAVIERSTOKES_NC_INDICES_HH
 
 #include <dumux/freeflow/navierstokes/indices.hh>
-#include <dumux/common/properties.hh>
 
 namespace Dumux {
 
-// \{
 /*!
  * \ingroup NavierStokesNCModel
  * \brief The common indices for the isothermal multi-component Navier-Stokes model.
- *
- * \tparam PVOffset The first index in a primary variable vector.
  */
 template <int dimension, int numEquations,
-          int thePhaseIdx, int theReplaceCompEqIdx,
-          int PVOffset = 0>
-struct NavierStokesNCIndices : public NavierStokesIndices<dimension, numEquations, PVOffset>
+          int thePhaseIdx, int theReplaceCompEqIdx>
+struct NavierStokesNCIndices : public NavierStokesIndices<dimension>
 {
-private:
-    using ParentType = NavierStokesIndices<dimension, numEquations, PVOffset>;
-
 public:
     static constexpr int phaseIdx = thePhaseIdx; //!< The phase index
     static constexpr int mainCompIdx = phaseIdx; //!< The index of the main component
 
     //! The index of the component whose mass balance will be replaced by the total one
     static constexpr int replaceCompEqIdx = theReplaceCompEqIdx;
-    static constexpr int totalMassBalanceIdx = replaceCompEqIdx; //!< Index of the total mass balance equation
-    static constexpr int conti0EqIdx = PVOffset; //!< The base index of the transport equations
-    static constexpr int pressureIdx = totalMassBalanceIdx; //!< Index of the pressure in a solution vector
 };
 
-// \}
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/freeflow/navierstokesnc/model.hh b/dumux/freeflow/navierstokesnc/model.hh
index 0677dd38915ba870b04ad6d38e8e0c8c4c1ff0bc..1251ca193e145a9c9272c2975af66c6b09a22abd 100644
--- a/dumux/freeflow/navierstokesnc/model.hh
+++ b/dumux/freeflow/navierstokesnc/model.hh
@@ -74,12 +74,15 @@ namespace Dumux {
  * \ingroup NavierStokesModel
  * \brief Traits for the Navier-Stokes multi-component model
  */
-template<int dim, int nComp>
+template<int dimension, int nComp, int phaseIdx, int replaceCompEqIdx>
 struct NavierStokesNCModelTraits
 {
+    //! The dimension of the model
+    static constexpr int dim() { return dimension; }
+
     //! There are as many momentum balance equations as dimensions
     //! and as many balance equations as components.
-    static constexpr int numEq() { return dim+nComp; }
+    static constexpr int numEq() { return dimension+nComp; }
 
     //! The number of phases is always 1
     static constexpr int numPhases() { return 1; }
@@ -95,6 +98,9 @@ struct NavierStokesNCModelTraits
 
     //! The model is isothermal
     static constexpr bool enableEnergyBalance() { return false; }
+
+    //! the indices
+    using Indices = NavierStokesNCIndices<dim(), numEq(), phaseIdx, replaceCompEqIdx>;
 };
 
 ///////////////////////////////////////////////////////////////////////////
@@ -124,8 +130,10 @@ private:
     static constexpr int dim = GridView::dimension;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static constexpr int numComponents = FluidSystem::numComponents;
+    static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
+    static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx);
 public:
-    using type = NavierStokesNCModelTraits<dim, numComponents>;
+    using type = NavierStokesNCModelTraits<dim, numComponents, phaseIdx, replaceCompEqIdx>;
 };
 
 SET_INT_PROP(NavierStokesNC, PhaseIdx, 0); //!< Defines the phaseIdx
@@ -141,18 +149,6 @@ SET_TYPE_PROP(NavierStokesNC, VolumeVariables, NavierStokesNCVolumeVariables<Typ
 //! The flux variables
 SET_TYPE_PROP(NavierStokesNC, FluxVariables, NavierStokesNCFluxVariables<TypeTag>);
 
-//! The indices
-SET_PROP(NavierStokesNC, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension;
-    static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
-    static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx);
-public:
-    using type = NavierStokesNCIndices<dim, numEq, phaseIdx, replaceCompEqIdx>;
-};
-
 //! The specific vtk output fields
 SET_PROP(NavierStokesNC, VtkOutputFields)
 {
@@ -194,22 +190,11 @@ private:
     static constexpr int dim = GridView::dimension;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static constexpr int numComponents = FluidSystem::numComponents;
-    using IsothermalModelTraits = NavierStokesNCModelTraits<dim, numComponents>;
-public:
-    using type = NavierStokesNIModelTraits<IsothermalModelTraits>;
-};
-
-//! The non-isothermal indices
-SET_PROP(NavierStokesNCNI, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension;
     static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
     static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx);
-    using IsothermalIndices = NavierStokesNCIndices<dim, numEq, phaseIdx, replaceCompEqIdx>;
+    using IsothermalModelTraits = NavierStokesNCModelTraits<dim, numComponents, phaseIdx, replaceCompEqIdx>;
 public:
-    using type = NavierStokesNonIsothermalIndices<dim, numEq, IsothermalIndices>;
+    using type = NavierStokesNIModelTraits<IsothermalModelTraits>;
 };
 
 //! The non-isothermal vtk output fields
diff --git a/dumux/freeflow/navierstokesnc/staggered/fluxvariables.hh b/dumux/freeflow/navierstokesnc/staggered/fluxvariables.hh
index 841a0ffa9dba79a4b344af1957770801552513df..e527bbe7d5a8ad79d1b5d710bb135961f5092bbf 100644
--- a/dumux/freeflow/navierstokesnc/staggered/fluxvariables.hh
+++ b/dumux/freeflow/navierstokesnc/staggered/fluxvariables.hh
@@ -52,7 +52,7 @@ class NavierStokesNCFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered>
     using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using MolecularDiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType);
 
@@ -97,7 +97,7 @@ public:
                 return density * fraction;
             };
 
-            flux[eqIdx] = ParentType::advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow);
+            flux[eqIdx - Indices::conti0EqIdx] = ParentType::advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow);
         }
 
         // in case one balance is substituted by the total mass balance
diff --git a/dumux/freeflow/navierstokesnc/staggered/localresidual.hh b/dumux/freeflow/navierstokesnc/staggered/localresidual.hh
index 511732d8a86bff209ea4d6883bd9339d8258c499..9051e1614d206a266e1c7b2c30e919d9b25e9f3f 100644
--- a/dumux/freeflow/navierstokesnc/staggered/localresidual.hh
+++ b/dumux/freeflow/navierstokesnc/staggered/localresidual.hh
@@ -51,7 +51,7 @@ class NavierStokesNCResidualImpl<TypeTag, DiscretizationMethod::staggered>
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using CellCenterResidual = CellCenterPrimaryVariables;
 
@@ -59,6 +59,7 @@ class NavierStokesNCResidualImpl<TypeTag, DiscretizationMethod::staggered>
 
     static constexpr int numComponents =ModelTraits::numComponents();
     static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr auto cellCenterOffset = ParentType::cellCenterOffset;
 
 public:
     using ParentType::ParentType;
@@ -76,7 +77,7 @@ public:
         // compute storage term of all components
         for (int compIdx = 0; compIdx < numComponents; ++compIdx)
         {
-            const int eqIdx = Indices::conti0EqIdx + compIdx;
+            const int eqIdx = compIdx;
 
             const Scalar massOrMoleFraction = useMoles ? volVars.moleFraction(compIdx) : volVars.massFraction(compIdx);
             const Scalar s =  density * massOrMoleFraction;
@@ -120,7 +121,7 @@ protected:
             {
                 const auto& insideVolVars = elemVolVars[insideScv];
                 const Scalar massOrMoleFraction = useMoles ? insideVolVars.moleFraction(compIdx) : insideVolVars.massFraction(compIdx);
-                residual[eqIdx] = massOrMoleFraction - problem.dirichletAtPos(insideScv.center())[eqIdx];
+                residual[eqIdx - cellCenterOffset] = massOrMoleFraction - problem.dirichletAtPos(insideScv.center())[eqIdx];
             }
         }
 
diff --git a/dumux/freeflow/navierstokesnc/volumevariables.hh b/dumux/freeflow/navierstokesnc/volumevariables.hh
index 50a05b317e26014532b1ef82e34e5789955d9581..a40cc720acc9912bf42895eef2ad81908c0030da 100644
--- a/dumux/freeflow/navierstokesnc/volumevariables.hh
+++ b/dumux/freeflow/navierstokesnc/volumevariables.hh
@@ -46,13 +46,12 @@ class NavierStokesNCVolumeVariables : virtual public NavierStokesVolumeVariables
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
 
     enum { numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(),
-           numPhases = FluidSystem::numPhases,
+           numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
            mainCompIdx = Indices::mainCompIdx,
            pressureIdx = Indices::pressureIdx
     };
@@ -61,8 +60,8 @@ class NavierStokesNCVolumeVariables : virtual public NavierStokesVolumeVariables
     static constexpr auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
 
 public:
-
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using FluidSystem = typename ParentType::FluidSystem;
+    using FluidState = typename ParentType::FluidState;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -92,7 +91,7 @@ public:
                 // binary diffusion coefficients
                 if(compIIdx != compJIdx)
                 {
-                    diffCoefficient_[phaseIdx][compIIdx][compJIdx]
+                    diffCoefficient_[compIIdx][compJIdx]
                         = FluidSystem::binaryDiffusionCoefficient(this->fluidState_,
                                                                   paramCache,
                                                                   phaseIdx,
@@ -128,9 +127,11 @@ public:
             if(compIdx == mainCompIdx)
                 continue;
 
+            int offset = mainCompIdx != 0 ? 1 : 0;
+
             // temporary add 1.0 to remove spurious differences in mole fractions
             // which are below the numerical accuracy
-            Scalar moleOrMassFraction = elemSol[0][Indices::conti0EqIdx+compIdx] + 1.0;
+            Scalar moleOrMassFraction = elemSol[0][Indices::conti0EqIdx+compIdx+offset] + 1.0;
             moleOrMassFraction = moleOrMassFraction - 1.0;
             if(useMoles)
                 fluidState.setMoleFraction(phaseIdx, compIdx, moleOrMassFraction);
@@ -196,7 +197,7 @@ public:
     {
         if (compIIdx == compJIdx)
             DUNE_THROW(Dune::InvalidStateException, "Diffusion coefficient called for phaseIdx = compIdx");
-        return diffCoefficient_[phaseIdx][compIIdx][compJIdx];
+        return diffCoefficient_[compIIdx][compJIdx];
     }
 
      /*!
@@ -218,7 +219,7 @@ protected:
     const Implementation &asImp_() const
     { return *static_cast<const Implementation*>(this); }
 
-    std::array<std::array<std::array<Scalar, numComponents>, numComponents>, numPhases> diffCoefficient_;
+    std::array<std::array<Scalar, numComponents>, numComponents> diffCoefficient_;
 };
 
 } // end namespace Dumux
diff --git a/dumux/freeflow/nonisothermal/indices.hh b/dumux/freeflow/nonisothermal/indices.hh
index cb73441208d435f20ff0f1514c5692e1eae7085e..5e09db53300558f5fb8cf6e6400c237ea3137bb9 100644
--- a/dumux/freeflow/nonisothermal/indices.hh
+++ b/dumux/freeflow/nonisothermal/indices.hh
@@ -24,30 +24,23 @@
 #ifndef DUMUX_NAVIERSTOKES_NI_INDICES_HH
 #define DUMUX_NAVIERSTOKES_NI_INDICES_HH
 
-#include <dumux/common/properties.hh>
+namespace Dumux {
 
-namespace Dumux
-{
-// \{
 /*!
  * \ingroup NavierStokesNIModel
  * \brief Indices for the non-isothermal Navier-Stokes model.
  *
- * \tparam dimension The dimension of the problem
- * \tparam numEquations The number of model equations
  * \tparam IsothermalIndices The isothermal indices class
- * \tparam PVOffset The first index in a primary variable vector.
+ * \tparam numEq the number of equations of the non-isothermal model
  */
-template <int dimension, int numEquations, class IsothermalIndices, int PVOffset = 0>
+template <class IsothermalIndices, int numEq>
 class NavierStokesNonIsothermalIndices : public IsothermalIndices
 {
 public:
-    static constexpr auto dim = dimension;
-    static constexpr auto numEq = numEquations;
-
-    static constexpr auto energyBalanceIdx = PVOffset + numEq - dim - 1;
-    static constexpr int temperatureIdx = energyBalanceIdx;
+    static constexpr int energyBalanceIdx = numEq - 1;
+    static constexpr int temperatureIdx = numEq - 1;
 };
-} // end namespace
+
+} // end namespace Dumux
 
 #endif // DUMUX_NAVIERSTOKES_NI_INDICES_HH
diff --git a/dumux/freeflow/nonisothermal/model.hh b/dumux/freeflow/nonisothermal/model.hh
index dfb04178c8485d36c427f4263e84a2f19b1a2f67..ef2626da3d24984535fc16b7618977c581c5a8ea 100644
--- a/dumux/freeflow/nonisothermal/model.hh
+++ b/dumux/freeflow/nonisothermal/model.hh
@@ -43,6 +43,8 @@
 #ifndef DUMUX_STAGGERED_NI_MODEL_HH
 #define DUMUX_STAGGERED_NI_MODEL_HH
 
+#include "indices.hh"
+
 namespace Dumux {
 
 /*!
@@ -58,6 +60,8 @@ struct NavierStokesNIModelTraits : public IsothermalTraits
     static constexpr int numEq() { return IsothermalTraits::numEq()+1; }
     //! We additionally solve for the equation balance
     static constexpr bool enableEnergyBalance() { return true; }
+    //! the indices
+    using Indices = NavierStokesNonIsothermalIndices<typename IsothermalTraits::Indices, numEq()>;
 };
 
 } // end  namespace Dumux
diff --git a/dumux/freeflow/rans/model.hh b/dumux/freeflow/rans/model.hh
index 7dd661567b655fb4a49c018f31148d37cb756609..297709f5decda5777ecfc2410115a427d4e8f499 100644
--- a/dumux/freeflow/rans/model.hh
+++ b/dumux/freeflow/rans/model.hh
@@ -49,8 +49,7 @@
 #include "volumevariables.hh"
 #include "vtkoutputfields.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 
 // \{
 ///////////////////////////////////////////////////////////////////////////
@@ -100,17 +99,6 @@ public:
     using type = NavierStokesNIModelTraits<IsothermalTraits>;
 };
 
-//! The indices required by the non-isothermal single-phase model
-SET_PROP(RANSNI, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension;
-    using IsothermalIndices = NavierStokesIndices<dim, numEq>;
-public:
-    using type = NavierStokesNonIsothermalIndices<dim, numEq, IsothermalIndices>;
-};
-
 //! The specific non-isothermal vtk output fields
 SET_PROP(RANSNI, VtkOutputFields)
 {
@@ -126,8 +114,7 @@ public:
 SET_TYPE_PROP(RANSNI, HeatConductionType, FouriersLaw<TypeTag>);
 
 // \}
-}
-
-} // end namespace
+} // end namespace Properties
+} // end namespace Dumux
 
 #endif // DUMUX_RANS_MODEL_HH
diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh
index 06f5ec7108fb3a19c920f4fc37b491667d963a47..5d730faf85a204a597d753b7e8c9f9cc5c68c424 100644
--- a/dumux/freeflow/rans/problem.hh
+++ b/dumux/freeflow/rans/problem.hh
@@ -61,7 +61,7 @@ class RANSProblem : public NavierStokesProblem<TypeTag>
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum {
         dim = Grid::dimension,
@@ -225,10 +225,11 @@ public:
 
             // calculate velocities
             DimVector velocityTemp(0.0);
+            static constexpr auto momentumBalanceIdx = 0;
             for (auto&& scvf : scvfs(fvGeometry))
             {
                 const int dofIdxFace = scvf.dofIndex();
-                const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][Indices::momentumBalanceIdx];
+                const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][momentumBalanceIdx];
                 velocityTemp[scvf.directionIndex()] += numericalSolutionFace;
             }
             for (unsigned int dimIdx = 0; dimIdx < dim; ++dimIdx)
@@ -284,8 +285,12 @@ public:
             for (auto&& scv : scvs(fvGeometry))
             {
                 const int dofIdx = scv.dofIndex();
-                CellCenterPrimaryVariables priVars(curSol[FVGridGeometry::cellCenterIdx()][dofIdx]);
-                auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
+
+                // construct a privars object from the cell center solution vector
+                const auto& cellCenterPriVars = curSol[FVGridGeometry::cellCenterIdx()][dofIdx];
+                PrimaryVariables priVars = makePriVarsFromCellCenterPriVars<PrimaryVariables>(cellCenterPriVars);
+                auto elemSol = elementSolution<typename FVGridGeometry::LocalView>(std::move(priVars));
+
                 VolumeVariables volVars;
                 volVars.update(elemSol, asImp_(), element, scv);
                 kinematicViscosity_[elementID] = volVars.viscosity() / volVars.density();
diff --git a/dumux/freeflow/rans/volumevariables.hh b/dumux/freeflow/rans/volumevariables.hh
index 811cd9e84db45266b89d16262046ff26a3528f62..e35379383e7451282679bb42e4d0ce66de172a01 100644
--- a/dumux/freeflow/rans/volumevariables.hh
+++ b/dumux/freeflow/rans/volumevariables.hh
@@ -62,8 +62,7 @@ class RANSVolumeVariablesImplementation<TypeTag, false>
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
 
@@ -72,6 +71,9 @@ class RANSVolumeVariablesImplementation<TypeTag, false>
     using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
 
 public:
+    using FluidSystem = typename ParentType::FluidSystem;
+    using FluidState = typename ParentType::FluidState;
+
     /*!
      * \brief Update all turbulent quantities for a given control volume
      *
@@ -228,6 +230,9 @@ class RANSVolumeVariablesImplementation<TypeTag, true>
     using Element = typename GridView::template Codim<0>::Entity;
 
 public:
+    using FluidSystem = typename ParentTypeIsothermal::FluidSystem;
+    using FluidState = typename ParentTypeIsothermal::FluidState;
+
     /*!
      * \brief Calculates the eddy thermal conductivity \f$\mathrm{[W/(m*K)]}\f$ based
      *        on the kinematic eddy viscosity and the turbulent prandtl number
diff --git a/dumux/freeflow/rans/zeroeq/model.hh b/dumux/freeflow/rans/zeroeq/model.hh
index bd768c9021a9f163a82d0b5fa123ee7f38b0efe7..2de4b348fe99e2ba65da685f4e378215f0d264d5 100644
--- a/dumux/freeflow/rans/zeroeq/model.hh
+++ b/dumux/freeflow/rans/zeroeq/model.hh
@@ -39,8 +39,7 @@
 
 #include "volumevariables.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 namespace Properties {
 
 ///////////////////////////////////////////////////////////////////////////
diff --git a/dumux/freeflow/rans/zeroeq/problem.hh b/dumux/freeflow/rans/zeroeq/problem.hh
index 5e12a5fc9e855aeeae3e39866ef8fef93e96a9e1..e0cc562f1a1432e35839ebd9a8cf74274d34c755 100644
--- a/dumux/freeflow/rans/zeroeq/problem.hh
+++ b/dumux/freeflow/rans/zeroeq/problem.hh
@@ -61,7 +61,7 @@ class ZeroEqProblem : public RANSProblem<TypeTag>
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum {
         dim = Grid::dimension,
@@ -115,8 +115,12 @@ public:
                 using std::exp;
 
                 const int dofIdx = scv.dofIndex();
-                CellCenterPrimaryVariables priVars(curSol[FVGridGeometry::cellCenterIdx()][dofIdx]);
-                auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
+
+                // construct a privars object from the cell center solution vector
+                const auto& cellCenterPriVars = curSol[FVGridGeometry::cellCenterIdx()][dofIdx];
+                PrimaryVariables priVars = makePriVarsFromCellCenterPriVars<PrimaryVariables>(cellCenterPriVars);
+                auto elemSol = elementSolution<typename FVGridGeometry::LocalView>(std::move(priVars));
+
                 VolumeVariables volVars;
                 volVars.update(elemSol, asImp_(), element, scv);
 
diff --git a/dumux/freeflow/rans/zeroeq/volumevariables.hh b/dumux/freeflow/rans/zeroeq/volumevariables.hh
index 3379f4a63d95de14e1690f1134f293890973e9e4..5a5ec53840ddad5122ba8e70c77392ad24f21230 100644
--- a/dumux/freeflow/rans/zeroeq/volumevariables.hh
+++ b/dumux/freeflow/rans/zeroeq/volumevariables.hh
@@ -61,14 +61,16 @@ class ZeroEqVolumeVariablesImplementation<TypeTag, false>
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
 
     static const int defaultPhaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
 
 public:
+    using FluidSystem = typename ParentType::FluidSystem;
+    using FluidState = typename ParentType::FluidState;
+
     /*!
      * \brief Update all quantities for a given control volume
      *
@@ -197,6 +199,9 @@ class ZeroEqVolumeVariablesImplementation<TypeTag, true>
     using Element = typename GridView::template Codim<0>::Entity;
 
 public:
+    using FluidSystem = typename ParentTypeIsothermal::FluidSystem;
+    using FluidState = typename ParentTypeIsothermal::FluidState;
+
     /*!
      * \brief Update all quantities for a given control volume
      *
diff --git a/dumux/freeflow/ransnc/indices.hh b/dumux/freeflow/ransnc/indices.hh
index 14017d77d093ff33713bb00918151331fb5b0722..fdccf477757f4d63d43d38506a2b83114310cb15 100644
--- a/dumux/freeflow/ransnc/indices.hh
+++ b/dumux/freeflow/ransnc/indices.hh
@@ -25,7 +25,6 @@
 #define DUMUX_STAGGERED_RANS_NC_INDICES_HH
 
 #include <dumux/freeflow/navierstokesnc/indices.hh>
-#include <dumux/common/properties.hh>
 
 namespace Dumux {
 
@@ -45,13 +44,13 @@ class DummyIndices
  */
 template <int dimension, int numEquations,
           int thePhaseIdx, int theReplaceCompEqIdx,
-          class SinglePhaseIndices = DummyIndices, int PVOffset = 0>
+          class SinglePhaseIndices = DummyIndices>
 struct RANSNCIndices
-    : public NavierStokesNCIndices<dimension, numEquations, thePhaseIdx, theReplaceCompEqIdx, PVOffset>,
+    : public NavierStokesNCIndices<dimension, numEquations, thePhaseIdx, theReplaceCompEqIdx>,
       public SinglePhaseIndices
 { };
 
 // \}
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/freeflow/ransnc/model.hh b/dumux/freeflow/ransnc/model.hh
index 4a443732bfe31388e75283a7776043254250af4e..e07821d7caa7f84fbb906e5a36c9538510b3a297 100644
--- a/dumux/freeflow/ransnc/model.hh
+++ b/dumux/freeflow/ransnc/model.hh
@@ -71,9 +71,14 @@ namespace Dumux {
  * \ingroup RANSModel
  * \brief Traits for the RANS multi-component model
  */
-template<int dim, int nComp>
-struct RANSNCModelTraits : NavierStokesNCModelTraits<dim, nComp>
-{ };
+template<int dim, int nComp, int phaseIdx, int replaceCompEqIdx>
+struct RANSNCModelTraits : NavierStokesNCModelTraits<dim, nComp, phaseIdx, replaceCompEqIdx>
+{
+private:
+    using ParentType = NavierStokesNCModelTraits<dim, nComp, phaseIdx, replaceCompEqIdx>;
+public:
+    using Indices = RANSNCIndices<dim, ParentType::numEq(), phaseIdx, replaceCompEqIdx>;
+};
 
 ///////////////////////////////////////////////////////////////////////////
 // properties for the single-phase, multi-component RANS model
@@ -96,18 +101,6 @@ NEW_TYPE_TAG(ZeroEqNC, INHERITS_FROM(ZeroEq, RANSNC));
 SET_TYPE_PROP(RANSNC, VolumeVariables, RANSNCVolumeVariables<TypeTag>);
 SET_TYPE_PROP(ZeroEqNC, SinglePhaseVolumeVariables, ZeroEqVolumeVariables<TypeTag>);
 
-//! The indices
-SET_PROP(RANSNC, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension;
-    static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
-    static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx);
-public:
-    using type = RANSNCIndices<dim, numEq, phaseIdx, replaceCompEqIdx>;
-};
-
 //! The specific vtk output fields
 SET_PROP(ZeroEqNC, VtkOutputFields)
 {
@@ -140,22 +133,11 @@ private:
     static constexpr int dim = GridView::dimension;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static constexpr int numComponents = FluidSystem::numComponents;
-    using IsothermalModelTraits = NavierStokesNCModelTraits<dim, numComponents>;
-public:
-    using type = NavierStokesNIModelTraits<IsothermalModelTraits>;
-};
-
-//! The indices
-SET_PROP(RANSNCNI, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension;
     static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
     static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx);
-    using IsothermalIndices = NavierStokesNCIndices<dim, numEq, phaseIdx, replaceCompEqIdx>;
+    using IsothermalModelTraits = NavierStokesNCModelTraits<dim, numComponents, phaseIdx, replaceCompEqIdx>;
 public:
-    using type = NavierStokesNonIsothermalIndices<dim, numEq, IsothermalIndices>;
+    using type = NavierStokesNIModelTraits<IsothermalModelTraits>;
 };
 
 //! The specific vtk output fields
@@ -176,5 +158,4 @@ public:
 } // end namespace Properties
 } // end namespace Dumux
 
-
 #endif
diff --git a/dumux/freeflow/ransnc/volumevariables.hh b/dumux/freeflow/ransnc/volumevariables.hh
index ddc67bd06f3c10dc189f897706ad829d26f06dd2..cae342af6debcd250cf9e49f985ee874309ffdb7 100644
--- a/dumux/freeflow/ransnc/volumevariables.hh
+++ b/dumux/freeflow/ransnc/volumevariables.hh
@@ -54,6 +54,9 @@ class RANSNCVolumeVariables
     static constexpr auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
 
 public:
+    using FluidSystem = typename ParentTypeCompositional::FluidSystem;
+    using FluidState = typename ParentTypeCompositional::FluidState;
+
     /*!
      * \brief Update all quantities for a given control volume
      *
diff --git a/dumux/io/plotthermalconductivitymodel.hh b/dumux/io/plotthermalconductivitymodel.hh
index a1681d5d1e4b316666f211950418bdec6e8c60cd..f759379a4b95364312dd56d0a2bb8acd084abbb8 100644
--- a/dumux/io/plotthermalconductivitymodel.hh
+++ b/dumux/io/plotthermalconductivitymodel.hh
@@ -41,9 +41,12 @@ template<class Scalar, class ThermalConductivityModel, class FluidSystem>
 class PlotThermalConductivityModel
 {
     using FluidState = CompositionalFluidState<Scalar, FluidSystem>;
-    enum {
-        wPhaseIdx = FluidSystem::wPhaseIdx,
-        nPhaseIdx = FluidSystem::nPhaseIdx
+
+    // phase indices
+    enum
+    {
+        phase0Idx = FluidSystem::phase0Idx,
+        phase1Idx = FluidSystem::phase1Idx
     };
 
 public:
@@ -61,10 +64,10 @@ public:
     {
         FluidState fluidstate;
         fluidstate.setTemperature(temperature);
-        fluidstate.setPressure(wPhaseIdx, pressure);
-        fluidstate.setPressure(nPhaseIdx, pressure);
-        lambdaW_ = FluidSystem::thermalConductivity(fluidstate, wPhaseIdx);
-        lambdaN_ = FluidSystem::thermalConductivity(fluidstate, nPhaseIdx);
+        fluidstate.setPressure(phase0Idx, pressure);
+        fluidstate.setPressure(phase1Idx, pressure);
+        lambdaW_ = FluidSystem::thermalConductivity(fluidstate, phase0Idx);
+        lambdaN_ = FluidSystem::thermalConductivity(fluidstate, phase1Idx);
     }
 
     /*!
diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh
index f2baf0b94e4a755a603d129b7716b5ebc73b6a4e..4c985a726b8d96ea58015cff50b735552c1f9bb7 100644
--- a/dumux/io/vtkoutputmodule.hh
+++ b/dumux/io/vtkoutputmodule.hh
@@ -218,35 +218,42 @@ private:
 template<typename TypeTag, int phaseIdxOffset = 0>
 class VtkOutputModule
 {
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput);
+    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
+    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    static constexpr int numPhases = ModelTraits::numPhases();
+
+    using VV = typename GridVariables::VolumeVariables;
+    using FluidSystem = typename VV::FluidSystem;
+    using Scalar = typename GridVariables::Scalar;
+
+    using GridView = typename FVGridGeometry::GridView;
     using ElementMapper = typename FVGridGeometry::ElementMapper;
     using VertexMapper = typename FVGridGeometry::VertexMapper;
-    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
-    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
 
     enum {
         dim = GridView::dimension,
         dimWorld = GridView::dimensionworld
     };
 
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
+    using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
 
-    static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases();
-    static constexpr bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box;
+    static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
     static constexpr int dofCodim = isBox ? dim : 0;
 
-    struct VolVarScalarDataInfo { std::function<Scalar(const VolumeVariables&)> get; std::string name; };
-    struct VolVarVectorDataInfo { std::function<GlobalPosition(const VolumeVariables&)> get; std::string name; };
+    struct VolVarScalarDataInfo { std::function<Scalar(const VV&)> get; std::string name; };
+    struct VolVarVectorDataInfo { std::function<GlobalPosition(const VV&)> get; std::string name; };
     using Field = Vtk::template Field<GridView>;
 
 public:
+    //! export type of the volume variables for the outputfields
+    using VolumeVariables = VV;
 
+    //! export field type
     enum class FieldType : unsigned int
     {
         element, vertex, automatic
diff --git a/dumux/material/chemistry/electrochemistry/electrochemistry.hh b/dumux/material/chemistry/electrochemistry/electrochemistry.hh
index 808c3c7b9bc4afad7cf7c3ef5f9360efbdd9f535..26dcca48ed3d9bfb2feed6c68ba362646f35e710 100644
--- a/dumux/material/chemistry/electrochemistry/electrochemistry.hh
+++ b/dumux/material/chemistry/electrochemistry/electrochemistry.hh
@@ -26,7 +26,6 @@
 
 #include <cmath>
 
-#include <dumux/common/properties.hh>
 #include <dumux/common/parameters.hh>
 #include <dumux/common/exceptions.hh>
 #include <dumux/discretization/methods.hh>
@@ -46,42 +45,36 @@ enum ElectroChemistryModel { Ochs, Acosta };
  * \brief This class calculates source terms and current densities for fuel cells
  * with the electrochemical models suggested by Ochs (2008) \cite ochs2008 or Acosta et al. (2006) \cite A3:acosta:2006
  * \todo TODO: Scalar type should be extracted from VolumeVariables!
+ * \todo TODO: This shouldn't depend on grid and discretization!!
  */
-template <class Scalar, class Indices, class FVGridGeometry, ElectroChemistryModel electroChemistryModel>
+template <class Scalar, class Indices, class FluidSystem, class FVGridGeometry, ElectroChemistryModel electroChemistryModel>
 class ElectroChemistry
 {
-    using FVElementGeometry = typename FVGridGeometry::LocalView;
-    using GridView = typename FVGridGeometry::GridView;
-    using Element = typename GridView::template Codim<0>::Entity;
 
     using Constant = Dumux::Constants<Scalar>;
 
-    enum {
-        //indices of the phases
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx
-    };
-    enum {
-        //indices of the components
-        wCompIdx = Indices::wCompIdx, //major component of the liquid phase
-        nCompIdx = Indices::nCompIdx, //major component of the gas phase
-        O2Idx = wCompIdx + 2
-    };
-    enum {
+    enum
+    {
         //indices of the primary variables
-        pressureIdx = Indices::pressureIdx, //gas-phase pressure
-        switchIdx = Indices::switchIdx, //liquid saturation or mole fraction
+        pressureIdx = Indices::pressureIdx, // gas-phase pressure
+        switchIdx = Indices::switchIdx,     // liquid saturation or mole fraction
     };
-    enum {
+    enum
+    {
         //equation indices
-        conti0EqIdx = Indices::conti0EqIdx,
-        contiH2OEqIdx = conti0EqIdx + wCompIdx,
-        contiO2EqIdx = conti0EqIdx + wCompIdx + 2,
+        contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
+        contiO2EqIdx = Indices::conti0EqIdx + FluidSystem::O2Idx,
     };
 
-    static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
-    enum { dofCodim = isBox ? GridView::dimension : 0 };
+    enum
+    {
+        // phase indices
+        liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
+        gasPhaseIdx = FluidSystem::gasPhaseIdx
+    };
 
+    using GridView = typename FVGridGeometry::GridView;
+    static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
     using GlobalPosition = typename Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>;
 
 public:
@@ -97,9 +90,9 @@ public:
     static void reactionSource(SourceValues &values, Scalar currentDensity,
                                const std::string& paramGroup = "")
     {
-        //correction to account for actually relevant reaction area
-        //current density has to be devided by the half length of the box
-        //\todo Do we have multiply with the electrochemically active surface area (ECSA) here instead?
+        // correction to account for actually relevant reaction area
+        // current density has to be devided by the half length of the box
+        // \todo Do we have multiply with the electrochemically active surface area (ECSA) here instead?
         static Scalar gridYMax = getParamFromGroup<GlobalPosition>(paramGroup, "Grid.UpperRight")[1];
         static Scalar nCellsY = getParamFromGroup<GlobalPosition>(paramGroup, "Grid.Cells")[1];
 
@@ -126,6 +119,7 @@ public:
     template<class VolumeVariables>
     static Scalar calculateCurrentDensity(const VolumeVariables &volVars)
     {
+
         static int maxIter = getParam<int>("ElectroChemistry.MaxIterations");
         static Scalar specificResistance = getParam<Scalar>("ElectroChemistry.SpecificResistance");
         static Scalar reversibleVoltage = getParam<Scalar>("ElectroChemistry.ReversibleVoltage");
@@ -147,7 +141,7 @@ public:
             Scalar activationLossesNext    = calculateActivationLosses_(volVars, currentDensity+deltaCurrentDensity);
             Scalar concentrationLosses     = calculateConcentrationLosses_(volVars);
             Scalar activationLossesDiff    = activationLossesNext - activationLosses;
-            Scalar sw                      = volVars.saturation(wPhaseIdx);
+            Scalar sw                      = volVars.saturation(liquidPhaseIdx);
 
             if(electroChemistryModel == ElectroChemistryModel::Acosta)
             {
@@ -202,11 +196,11 @@ private:
         static Scalar transferCoefficient = getParam<Scalar>("ElectroChemistry.TransferCoefficient");
 
         //Saturation sw for Acosta calculation
-        Scalar sw = volVars.saturation(wPhaseIdx);
+        Scalar sw = volVars.saturation(liquidPhaseIdx);
         //Calculate prefactor
         Scalar preFactor = Constant::R*volVars.fluidState().temperature()/transferCoefficient/Constant::F/numElectrons;
         //Get partial pressure of O2 in the gas phase
-        Scalar pO2 = volVars.pressure(nPhaseIdx) * volVars.fluidState().moleFraction(nPhaseIdx, O2Idx);
+        Scalar pO2 = volVars.pressure(gasPhaseIdx) * volVars.fluidState().moleFraction(gasPhaseIdx, FluidSystem::O2Idx);
 
         Scalar losses = 0.0;
         //Calculate activation losses
@@ -245,7 +239,7 @@ private:
         //Calculate preFactor
         Scalar preFactor = Constant::R*volVars.temperature()/transferCoefficient/Constant::F/numElectrons;
         //Get partial pressure of O2 in the gas phase
-        Scalar pO2 = volVars.pressure(nPhaseIdx) * volVars.fluidState().moleFraction(nPhaseIdx, O2Idx);
+        Scalar pO2 = volVars.pressure(gasPhaseIdx) * volVars.fluidState().moleFraction(gasPhaseIdx, FluidSystem::O2Idx);
 
         Scalar losses = 0.0;
         //Calculate concentration losses
diff --git a/dumux/material/chemistry/electrochemistry/electrochemistryni.hh b/dumux/material/chemistry/electrochemistry/electrochemistryni.hh
index 4b9de9329357a19e47700c875b41c527c468bdde..a1a0eae0f5ad4c31fcc3f9a1b3f5ce94eae53298 100644
--- a/dumux/material/chemistry/electrochemistry/electrochemistryni.hh
+++ b/dumux/material/chemistry/electrochemistry/electrochemistryni.hh
@@ -24,7 +24,6 @@
 #ifndef DUMUX_ELECTROCHEMISTRY_NI_HH
 #define DUMUX_ELECTROCHEMISTRY_NI_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/material/constants.hh>
 #include <dumux/material/chemistry/electrochemistry/electrochemistry.hh>
 
@@ -36,30 +35,23 @@ namespace Dumux {
  * with the electrochemical models suggested by Ochs (2008) \cite ochs2008 or Acosta (2006) \cite A3:acosta:2006
  * for the non-isothermal case.
  * \todo TODO: Scalar type should be extracted from VolumeVariables!
+ * \todo TODO: This shouldn't depend on discretization and grid!!
  */
 template <class Scalar, class Indices, class FVGridGeometry, ElectroChemistryModel electroChemistryModel>
 class ElectroChemistryNI : public ElectroChemistry<Scalar, Indices, FVGridGeometry, electroChemistryModel>
 {
     using ParentType = ElectroChemistry<Scalar, Indices, FVGridGeometry, electroChemistryModel>;
-    using GridView = typename FVGridGeometry::GridView;
     using Constant = Constants<Scalar>;
 
     enum {
-        //indices of the components
-        wCompIdx = Indices::wCompIdx, //major component of the liquid phase
-        nCompIdx = Indices::nCompIdx, //major component of the gas phase
-        O2Idx = wCompIdx + 2
-    };
-    enum { //equation indices
-            conti0EqIdx = Indices::conti0EqIdx,
-            contiH2OEqIdx = conti0EqIdx + wCompIdx,
-            contiO2EqIdx = conti0EqIdx + wCompIdx + 2,
-            energyEqIdx = Indices::energyEqIdx, //energy equation
+        //equation indices
+        contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
+        contiO2EqIdx = Indices::conti0EqIdx + FluidSystem::O2Idx,
+        energyEqIdx = Indices::energyEqIdx, //energy equation
     };
 
+    using GridView = typename FVGridGeometry::GridView;
     static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
-    enum { dofCodim = isBox ? GridView::dimension : 0 };
-
     using GlobalPosition = typename Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>;
     using CellVector = typename Dune::FieldVector<typename GridView::ctype, GridView::dimension>;
 
diff --git a/dumux/material/components/trichloroethene.hh b/dumux/material/components/trichloroethene.hh
index 0be32475fee403440bdea1050a00655f46d4c2b3..41bd5aa1957ff4feac1b88eb1c0f8007575c6078 100644
--- a/dumux/material/components/trichloroethene.hh
+++ b/dumux/material/components/trichloroethene.hh
@@ -116,6 +116,12 @@ public:
     static constexpr bool liquidIsCompressible()
     { return false; }
 
+    /*!
+     * \brief Returns true if the liquid phase viscostiy is constant
+     */
+    static constexpr bool liquidViscosityIsConstant()
+    { return true; }
+
     /*!
      * \brief The density of steam at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$.
      *
diff --git a/dumux/material/constraintsolvers/compositionalflash.hh b/dumux/material/constraintsolvers/compositionalflash.hh
index 834ec781fb061d43d7a4791d8147b28c9c7bd482..a49d22970d5bf8fb2d77366daa991716276355a3 100644
--- a/dumux/material/constraintsolvers/compositionalflash.hh
+++ b/dumux/material/constraintsolvers/compositionalflash.hh
@@ -47,10 +47,10 @@ class CompositionalFlash
         };
 
     enum{
-        wPhaseIdx = FluidSystem::wPhaseIdx,
-        nPhaseIdx = FluidSystem::nPhaseIdx,
-        wCompIdx = FluidSystem::wCompIdx,
-        nCompIdx = FluidSystem::nCompIdx
+        phase0Idx = FluidSystem::phase0Idx,
+        phase1Idx = FluidSystem::phase1Idx,
+        comp0Idx = FluidSystem::comp0Idx,
+        comp1Idx = FluidSystem::comp1Idx
     };
 
 public:
@@ -82,93 +82,93 @@ public:
     {
         // set the temperature, pressure
         fluidState.setTemperature(temperature);
-        fluidState.setPressure(wPhaseIdx, phasePressure[wPhaseIdx]);
-        fluidState.setPressure(nPhaseIdx, phasePressure[nPhaseIdx]);
+        fluidState.setPressure(phase0Idx, phasePressure[phase0Idx]);
+        fluidState.setPressure(phase1Idx, phasePressure[phase1Idx]);
 
         //mole equilibrium ratios K for in case wPhase is reference phase
-        double k1 = FluidSystem::fugacityCoefficient(fluidState, wPhaseIdx, wCompIdx);    // = p^wComp_vap
-        double k2 = FluidSystem::fugacityCoefficient(fluidState, wPhaseIdx, nCompIdx);    // = H^nComp_w
+        double k1 = FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx);    // = p^wComp_vap
+        double k2 = FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx);    // = H^nComp_w
 
         // get mole fraction from equilibrium konstants
-        fluidState.setMoleFraction(wPhaseIdx,wCompIdx, ((1. - k2) / (k1 -k2)));
-        fluidState.setMoleFraction(nPhaseIdx,wCompIdx, (fluidState.moleFraction(wPhaseIdx,wCompIdx) * k1));
+        fluidState.setMoleFraction(phase0Idx,comp0Idx, ((1. - k2) / (k1 -k2)));
+        fluidState.setMoleFraction(phase1Idx,comp0Idx, (fluidState.moleFraction(phase0Idx,comp0Idx) * k1));
 
         // transform mole to mass fractions
-        fluidState.setMassFraction(wPhaseIdx, wCompIdx,
-                (fluidState.moleFraction(wPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                / ( fluidState.moleFraction(wPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                    + (1.-fluidState.moleFraction(wPhaseIdx,wCompIdx)) * FluidSystem::molarMass(nCompIdx) )));
-        fluidState.setMassFraction(nPhaseIdx,wCompIdx,
-                (fluidState.moleFraction(nPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                / ( fluidState.moleFraction(nPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                    + (1.-fluidState.moleFraction(nPhaseIdx,wCompIdx)) * FluidSystem::molarMass(nCompIdx) )));
+        fluidState.setMassFraction(phase0Idx, comp0Idx,
+                (fluidState.moleFraction(phase0Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                / ( fluidState.moleFraction(phase0Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                    + (1.-fluidState.moleFraction(phase0Idx,comp0Idx)) * FluidSystem::molarMass(comp1Idx) )));
+        fluidState.setMassFraction(phase1Idx,comp0Idx,
+                (fluidState.moleFraction(phase1Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                / ( fluidState.moleFraction(phase1Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                    + (1.-fluidState.moleFraction(phase1Idx,comp0Idx)) * FluidSystem::molarMass(comp1Idx) )));
 
         //mass equilibrium ratios
         Scalar equilRatio_[numPhases][numComponents];
-        equilRatio_[nPhaseIdx][wCompIdx] = fluidState.massFraction(nPhaseIdx,wCompIdx)
-                / fluidState.massFraction(wPhaseIdx, wCompIdx);     // = Xn1 / Xw1 = K1
-        equilRatio_[nPhaseIdx][nCompIdx] = (1.-fluidState.massFraction(nPhaseIdx, wCompIdx))
-                / (1.-fluidState.massFraction(wPhaseIdx, wCompIdx)); // =(1.-Xn1) / (1.-Xw1)     = K2
-        equilRatio_[wPhaseIdx][nCompIdx] = equilRatio_[wPhaseIdx][wCompIdx] = 1.;
+        equilRatio_[phase1Idx][comp0Idx] = fluidState.massFraction(phase1Idx,comp0Idx)
+                / fluidState.massFraction(phase0Idx, comp0Idx);     // = Xn1 / Xw1 = K1
+        equilRatio_[phase1Idx][comp1Idx] = (1.-fluidState.massFraction(phase1Idx, comp0Idx))
+                / (1.-fluidState.massFraction(phase0Idx, comp0Idx)); // =(1.-Xn1) / (1.-Xw1)     = K2
+        equilRatio_[phase0Idx][comp1Idx] = equilRatio_[phase0Idx][comp0Idx] = 1.;
 
         // phase fraction of nPhase [mass/totalmass]
-        fluidState.setNu(nPhaseIdx, 0.);
+        fluidState.setNu(phase1Idx, 0.);
 
         // check if there is enough of component 1 to form a phase
-        if (Z1 > fluidState.massFraction(nPhaseIdx,wCompIdx)
-                             && Z1 < fluidState.massFraction(wPhaseIdx,wCompIdx))
-            fluidState.setNu(nPhaseIdx, -((equilRatio_[nPhaseIdx][wCompIdx]-1)*Z1 + (equilRatio_[nPhaseIdx][nCompIdx]-1)*(1-Z1))
-                                / (equilRatio_[nPhaseIdx][wCompIdx]-1) / (equilRatio_[nPhaseIdx][nCompIdx] -1));
-        else if (Z1 <= fluidState.massFraction(nPhaseIdx,wCompIdx)) // too little wComp to form a phase
+        if (Z1 > fluidState.massFraction(phase1Idx,comp0Idx)
+                             && Z1 < fluidState.massFraction(phase0Idx,comp0Idx))
+            fluidState.setNu(phase1Idx, -((equilRatio_[phase1Idx][comp0Idx]-1)*Z1 + (equilRatio_[phase1Idx][comp1Idx]-1)*(1-Z1))
+                                / (equilRatio_[phase1Idx][comp0Idx]-1) / (equilRatio_[phase1Idx][comp1Idx] -1));
+        else if (Z1 <= fluidState.massFraction(phase1Idx,comp0Idx)) // too little wComp to form a phase
         {
-            fluidState.setNu(nPhaseIdx, 1.); // only nPhase
-            fluidState.setMassFraction(nPhaseIdx,wCompIdx, Z1); // hence, assign complete mass dissolved into nPhase
+            fluidState.setNu(phase1Idx, 1.); // only nPhase
+            fluidState.setMassFraction(phase1Idx,comp0Idx, Z1); // hence, assign complete mass dissolved into nPhase
 
             // store as moleFractions
-            Scalar xw_n = Z1 /*=Xw_n*/ / FluidSystem::molarMass(wCompIdx);  // = moles of compIdx
-            xw_n /= ( Z1 /*=Xw_n*/ / FluidSystem::molarMass(wCompIdx)
-                    +(1- Z1 /*=Xn_n*/) / FluidSystem::molarMass(nCompIdx) ); // /= total moles in phase
+            Scalar xw_n = Z1 /*=Xw_n*/ / FluidSystem::molarMass(comp0Idx);  // = moles of compIdx
+            xw_n /= ( Z1 /*=Xw_n*/ / FluidSystem::molarMass(comp0Idx)
+                    +(1- Z1 /*=Xn_n*/) / FluidSystem::molarMass(comp1Idx) ); // /= total moles in phase
 
-            fluidState.setMoleFraction(nPhaseIdx,wCompIdx, xw_n);
+            fluidState.setMoleFraction(phase1Idx,comp0Idx, xw_n);
 
 //            // opposing non-present phase is already set to equilibrium mass fraction
-//            fluidState.setMassFraction(wPhaseIdx,wCompIdx, 1.); // non present phase is set to be pure
-//            fluidState.setMoleFraction(wPhaseIdx,wCompIdx, 1.); // non present phase is set to be pure
+//            fluidState.setMassFraction(phase0Idx,comp0Idx, 1.); // non present phase is set to be pure
+//            fluidState.setMoleFraction(phase0Idx,comp0Idx, 1.); // non present phase is set to be pure
         }
         else    // (Z1 >= Xw1) => no nPhase
         {
-            fluidState.setNu(nPhaseIdx, 0.); // no second phase
-            fluidState.setMassFraction(wPhaseIdx, wCompIdx, Z1);
+            fluidState.setNu(phase1Idx, 0.); // no second phase
+            fluidState.setMassFraction(phase0Idx, comp0Idx, Z1);
 
             // store as moleFractions
-            Scalar xw_w = Z1 /*=Xw_w*/ / FluidSystem::molarMass(wCompIdx);  // = moles of compIdx
-            xw_w /= ( Z1 /*=Xw_w*/ / FluidSystem::molarMass(wCompIdx)
-                    +(1- Z1 /*=Xn_w*/) / FluidSystem::molarMass(nCompIdx) ); // /= total moles in phase
-            fluidState.setMoleFraction(wPhaseIdx, wCompIdx, xw_w);
+            Scalar xw_w = Z1 /*=Xw_w*/ / FluidSystem::molarMass(comp0Idx);  // = moles of compIdx
+            xw_w /= ( Z1 /*=Xw_w*/ / FluidSystem::molarMass(comp0Idx)
+                    +(1- Z1 /*=Xn_w*/) / FluidSystem::molarMass(comp1Idx) ); // /= total moles in phase
+            fluidState.setMoleFraction(phase0Idx, comp0Idx, xw_w);
 
 //            // opposing non-present phase is already set to equilibrium mass fraction
-//            fluidState.setMassFraction(nPhaseIdx,wCompIdx, 0.); // non present phase is set to be pure
-//            fluidState.setMoleFraction(nPhaseIdx,wCompIdx, 0.); // non present phase is set to be pure
+//            fluidState.setMassFraction(phase1Idx,comp0Idx, 0.); // non present phase is set to be pure
+//            fluidState.setMoleFraction(phase1Idx,comp0Idx, 0.); // non present phase is set to be pure
         }
 
         // complete array of mass fractions
-        fluidState.setMassFraction(wPhaseIdx, nCompIdx, 1. - fluidState.massFraction(wPhaseIdx,wCompIdx));
-        fluidState.setMassFraction(nPhaseIdx, nCompIdx, 1. - fluidState.massFraction(nPhaseIdx,wCompIdx));
+        fluidState.setMassFraction(phase0Idx, comp1Idx, 1. - fluidState.massFraction(phase0Idx,comp0Idx));
+        fluidState.setMassFraction(phase1Idx, comp1Idx, 1. - fluidState.massFraction(phase1Idx,comp0Idx));
         // complete array of mole fractions
-        fluidState.setMoleFraction(wPhaseIdx, nCompIdx, 1. - fluidState.moleFraction(wPhaseIdx,wCompIdx));
-        fluidState.setMoleFraction(nPhaseIdx, nCompIdx, 1. - fluidState.moleFraction(nPhaseIdx,wCompIdx));
+        fluidState.setMoleFraction(phase0Idx, comp1Idx, 1. - fluidState.moleFraction(phase0Idx,comp0Idx));
+        fluidState.setMoleFraction(phase1Idx, comp1Idx, 1. - fluidState.moleFraction(phase1Idx,comp0Idx));
 
         // complete phase mass fractions
-        fluidState.setNu(wPhaseIdx, 1. - fluidState.phaseMassFraction(nPhaseIdx));
+        fluidState.setNu(phase0Idx, 1. - fluidState.phaseMassFraction(phase1Idx));
 
         // get densities with correct composition
-        fluidState.setDensity(wPhaseIdx, FluidSystem::density(fluidState, wPhaseIdx));
-        fluidState.setDensity(nPhaseIdx, FluidSystem::density(fluidState, nPhaseIdx));
+        fluidState.setDensity(phase0Idx, FluidSystem::density(fluidState, phase0Idx));
+        fluidState.setDensity(phase1Idx, FluidSystem::density(fluidState, phase1Idx));
 
-        Scalar sw = fluidState.phaseMassFraction(wPhaseIdx) / fluidState.density(wPhaseIdx);
-        sw /= (fluidState.phaseMassFraction(wPhaseIdx)/fluidState.density(wPhaseIdx)
-                    + fluidState.phaseMassFraction(nPhaseIdx)/fluidState.density(nPhaseIdx));
-        fluidState.setSaturation(wPhaseIdx, sw);
+        Scalar sw = fluidState.phaseMassFraction(phase0Idx) / fluidState.density(phase0Idx);
+        sw /= (fluidState.phaseMassFraction(phase0Idx)/fluidState.density(phase0Idx)
+                    + fluidState.phaseMassFraction(phase1Idx)/fluidState.density(phase1Idx));
+        fluidState.setSaturation(phase0Idx, sw);
     }
 
     /*! The simplest possible update routine for 1p2c "flash" calculations
@@ -188,51 +188,51 @@ public:
     {
         // set the temperature, pressure
         fluidState.setTemperature(temperature);
-        fluidState.setPressure(wPhaseIdx, phasePressure[wPhaseIdx]);
-        fluidState.setPressure(nPhaseIdx, phasePressure[nPhaseIdx]);
+        fluidState.setPressure(phase0Idx, phasePressure[phase0Idx]);
+        fluidState.setPressure(phase1Idx, phasePressure[phase1Idx]);
 
         fluidState.setPresentPhaseIdx(presentPhaseIdx);
-        fluidState.setMassFraction(presentPhaseIdx,wCompIdx, Z1);
+        fluidState.setMassFraction(presentPhaseIdx,comp0Idx, Z1);
 
         // calculate mole fraction and average molar mass
-        Scalar xw_alpha= Z1 / FluidSystem::molarMass(wCompIdx);
-        xw_alpha /= ( Z1 / FluidSystem::molarMass(wCompIdx)
-                + (1.-Z1) / FluidSystem::molarMass(nCompIdx));
-        fluidState.setMoleFraction(presentPhaseIdx, wCompIdx, xw_alpha);
+        Scalar xw_alpha= Z1 / FluidSystem::molarMass(comp0Idx);
+        xw_alpha /= ( Z1 / FluidSystem::molarMass(comp0Idx)
+                + (1.-Z1) / FluidSystem::molarMass(comp1Idx));
+        fluidState.setMoleFraction(presentPhaseIdx, comp0Idx, xw_alpha);
 
-//        if (presentPhaseIdx == wPhaseIdx)
+//        if (presentPhaseIdx == phase0Idx)
 //        {
 //
-////            fluidState.setMassFraction(wPhaseIdx,wCompIdx, 0.;
+////            fluidState.setMassFraction(phase0Idx,comp0Idx, 0.;
 //
 //
 //
 //
 //
-////            fluidState.moleFractionWater_[nPhaseIdx] = 0.;
+////            fluidState.moleFractionWater_[phase1Idx] = 0.;
 //
 //            fluidState.setPresentPhaseIdx(presentPhaseIdx);
 //        }
-//        else if (presentPhaseIdx == nPhaseIdx)
+//        else if (presentPhaseIdx == phase1Idx)
 //        {
-//            fluidState.setMassFraction[wPhaseIdx] = 0.;
-//            fluidState.setMassFraction[nPhaseIdx] = Z1;
+//            fluidState.setMassFraction[phase0Idx] = 0.;
+//            fluidState.setMassFraction[phase1Idx] = Z1;
 //
 //            // interested in nComp => 1-X1
-//            fluidState.moleFractionWater_[nPhaseIdx] = ( Z1 / FluidSystem::molarMass(0) );   // = moles of compIdx
-//            fluidState.moleFractionWater_[nPhaseIdx] /= (Z1/ FluidSystem::molarMass(0)
+//            fluidState.moleFractionWater_[phase1Idx] = ( Z1 / FluidSystem::molarMass(0) );   // = moles of compIdx
+//            fluidState.moleFractionWater_[phase1Idx] /= (Z1/ FluidSystem::molarMass(0)
 //                           + (1.-Z1) / FluidSystem::molarMass(1) );    // /= total moles in phase
-//            fluidState.moleFractionWater_[nPhaseIdx] = 0.;
+//            fluidState.moleFractionWater_[phase1Idx] = 0.;
 //
-//            fluidState.presentPhaseIdx_ = nPhaseIdx;
+//            fluidState.presentPhaseIdx_ = phase1Idx;
 //        }
 //        else
 //            Dune::dgrave << __FILE__ <<": Twophase conditions in single-phase flash!"
 //                << " Z1 is "<<Z1<< std::endl;
 
         fluidState.setAverageMolarMass(presentPhaseIdx,
-                fluidState.massFraction(presentPhaseIdx, wCompIdx)*FluidSystem::molarMass(wCompIdx)
-                +fluidState.massFraction(presentPhaseIdx, nCompIdx)*FluidSystem::molarMass(nCompIdx));
+                fluidState.massFraction(presentPhaseIdx, comp0Idx)*FluidSystem::molarMass(comp0Idx)
+                +fluidState.massFraction(presentPhaseIdx, comp1Idx)*FluidSystem::molarMass(comp1Idx));
 
         fluidState.setDensity(presentPhaseIdx, FluidSystem::density(fluidState, presentPhaseIdx));
     }
@@ -263,44 +263,44 @@ public:
     {
         // set the temperature, pressure
         fluidState.setTemperature(temperature);
-        fluidState.setPressure(wPhaseIdx, phasePressure[wPhaseIdx]);
-        fluidState.setPressure(nPhaseIdx, phasePressure[nPhaseIdx]);
+        fluidState.setPressure(phase0Idx, phasePressure[phase0Idx]);
+        fluidState.setPressure(phase1Idx, phasePressure[phase1Idx]);
 
         //in contrast to the standard update() method, satflash() does not calculate nu.
-        fluidState.setNu(wPhaseIdx, NAN);
-        fluidState.setNu(nPhaseIdx, NAN);
+        fluidState.setNu(phase0Idx, NAN);
+        fluidState.setNu(phase1Idx, NAN);
 
         //mole equilibrium ratios K for in case wPhase is reference phase
-        double k1 = FluidSystem::fugacityCoefficient(fluidState, wPhaseIdx, wCompIdx);    // = p^wComp_vap
-        double k2 = FluidSystem::fugacityCoefficient(fluidState, wPhaseIdx, nCompIdx);    // = H^nComp_w
+        double k1 = FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx);    // = p^wComp_vap
+        double k2 = FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx);    // = H^nComp_w
 
         // get mole fraction from equilibrium konstants
-        fluidState.setMoleFraction(wPhaseIdx,wCompIdx, ((1. - k2) / (k1 -k2)));
-        fluidState.setMoleFraction(nPhaseIdx,wCompIdx, (fluidState.moleFraction(wPhaseIdx,wCompIdx) * k1));
+        fluidState.setMoleFraction(phase0Idx,comp0Idx, ((1. - k2) / (k1 -k2)));
+        fluidState.setMoleFraction(phase1Idx,comp0Idx, (fluidState.moleFraction(phase0Idx,comp0Idx) * k1));
 
         // transform mole to mass fractions
-        fluidState.setMassFraction(wPhaseIdx, wCompIdx,
-                (fluidState.moleFraction(wPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                / ( fluidState.moleFraction(wPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                    + (1.-fluidState.moleFraction(wPhaseIdx,wCompIdx)) * FluidSystem::molarMass(nCompIdx) )));
-        fluidState.setMassFraction(nPhaseIdx,wCompIdx,
-                (fluidState.moleFraction(nPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                / ( fluidState.moleFraction(nPhaseIdx,wCompIdx) * FluidSystem::molarMass(wCompIdx)
-                    + (1.-fluidState.moleFraction(nPhaseIdx,wCompIdx)) * FluidSystem::molarMass(nCompIdx) )));
+        fluidState.setMassFraction(phase0Idx, comp0Idx,
+                (fluidState.moleFraction(phase0Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                / ( fluidState.moleFraction(phase0Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                    + (1.-fluidState.moleFraction(phase0Idx,comp0Idx)) * FluidSystem::molarMass(comp1Idx) )));
+        fluidState.setMassFraction(phase1Idx,comp0Idx,
+                (fluidState.moleFraction(phase1Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                / ( fluidState.moleFraction(phase1Idx,comp0Idx) * FluidSystem::molarMass(comp0Idx)
+                    + (1.-fluidState.moleFraction(phase1Idx,comp0Idx)) * FluidSystem::molarMass(comp1Idx) )));
 
         // complete array of mass fractions
-        fluidState.setMassFraction(wPhaseIdx, nCompIdx, 1. - fluidState.massFraction(wPhaseIdx,wCompIdx));
-        fluidState.setMassFraction(nPhaseIdx, nCompIdx, 1. - fluidState.massFraction(nPhaseIdx,wCompIdx));
+        fluidState.setMassFraction(phase0Idx, comp1Idx, 1. - fluidState.massFraction(phase0Idx,comp0Idx));
+        fluidState.setMassFraction(phase1Idx, comp1Idx, 1. - fluidState.massFraction(phase1Idx,comp0Idx));
         // complete array of mole fractions
-        fluidState.setMoleFraction(wPhaseIdx, nCompIdx, 1. - fluidState.moleFraction(wPhaseIdx,wCompIdx));
-        fluidState.setMoleFraction(nPhaseIdx, nCompIdx, 1. - fluidState.moleFraction(nPhaseIdx,wCompIdx));
+        fluidState.setMoleFraction(phase0Idx, comp1Idx, 1. - fluidState.moleFraction(phase0Idx,comp0Idx));
+        fluidState.setMoleFraction(phase1Idx, comp1Idx, 1. - fluidState.moleFraction(phase1Idx,comp0Idx));
 
         // get densities with correct composition
-        fluidState.setDensity(wPhaseIdx, FluidSystem::density(fluidState, wPhaseIdx));
-        fluidState.setDensity(nPhaseIdx, FluidSystem::density(fluidState, nPhaseIdx));
+        fluidState.setDensity(phase0Idx, FluidSystem::density(fluidState, phase0Idx));
+        fluidState.setDensity(phase1Idx, FluidSystem::density(fluidState, phase1Idx));
 
         // set saturation
-        fluidState.setSaturation(wPhaseIdx, saturation);
+        fluidState.setSaturation(phase0Idx, saturation);
     }
 //@}
 };
diff --git a/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh b/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh
index de0c8d64056cf6eac4b79b3e774f55e1428f99f1..a51839547045b147003e7953dee6bb820713f29e 100644
--- a/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh
+++ b/dumux/material/constraintsolvers/misciblemultiphasecomposition.hh
@@ -57,7 +57,7 @@ namespace Dumux {
  * - if the setViscosity parameter is true, also dynamic viscosities of *all* phases
  * - if the setEnthalpy parameter is true, also specific enthalpies of *all* phases
  */
-template <class Scalar, class FluidSystem, bool useKelvinEquation = false>
+template <class Scalar, class FluidSystem>
 class MiscibleMultiPhaseComposition
 {
     static constexpr int numPhases = FluidSystem::numPhases;
@@ -140,9 +140,9 @@ public:
             }
         }
 
-        //set the additional equations for the numComponents-numMajorComponents
+        // set the additional equations for the numComponents-numMajorComponents
         // this is only relevant if numphases != numcomponents e.g. in a 2pnc system
-        //Components, of which the molefractions are known, set to molefraction(knownCompIdx)=xKnown
+        // Components, of which the molefractions are known, set to molefraction(knownCompIdx)=xKnown
         for(int knownCompIdx = 0; knownCompIdx < numComponents-numMajorComponents; ++knownCompIdx)
         {
             int rowIdx = numComponents + numPhases + knownCompIdx;
@@ -156,70 +156,31 @@ public:
         for (int compIdx = 0; compIdx < numComponents; ++compIdx)
         {
             int col1Idx = compIdx;
-            Scalar entryPhase0 = 0.0;
-            for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
-            {
-                Scalar entry = fluidState.fugacityCoefficient(phaseIdx, compIdx)
-                               * fluidState.pressure(phaseIdx);
-
-                // modify the saturation vapor pressure of the wetting component by the Kelvin equation
-                if (compIdx == FluidSystem::wCompIdx
-                    && phaseIdx == FluidSystem::wPhaseIdx
-                    && useKelvinEquation)
-                {
-                    // a new fluidState is needed, because mole fractions are unknown
-                    FluidState purePhaseFluidState;
-                    // assign all phase pressures, needed for capillary pressure
-                    for (unsigned int idx = 0; idx < numPhases; ++idx)
-                    {
-                        purePhaseFluidState.setPressure(idx, fluidState.pressure(idx));
-                    }
-                    purePhaseFluidState.setTemperature(fluidState.temperature());
-                    purePhaseFluidState.setMoleFraction(phaseIdx, compIdx, 1.0);
-                    entry = FluidSystem::kelvinVaporPressure(purePhaseFluidState, phaseIdx, compIdx);
-                }
+            const auto entryPhase0 = fluidState.fugacityCoefficient(0, compIdx)*fluidState.pressure(0);
 
-                if (phaseIdx == 0)
-                {
-                    entryPhase0 = entry;
-                }
-                else
-                {
-                    int rowIdx = (phaseIdx - 1)*numComponents + compIdx;
-                    int col2Idx = phaseIdx*numComponents + compIdx;
-                    M[rowIdx][col1Idx] = entryPhase0;
-                    M[rowIdx][col2Idx] = -entry;
-                }
+            for (unsigned int phaseIdx = 1; phaseIdx < numPhases; ++phaseIdx)
+            {
+                int rowIdx = (phaseIdx - 1)*numComponents + compIdx;
+                int col2Idx = phaseIdx*numComponents + compIdx;
+                M[rowIdx][col1Idx] = entryPhase0;
+                M[rowIdx][col2Idx] = -fluidState.fugacityCoefficient(phaseIdx, compIdx)*fluidState.pressure(phaseIdx);
             }
         }
 
-
-        //preconditioning of M to reduce condition number
-        //prevents matrix meeting dune's singularity criteria
+        // preconditioning of M to reduce condition number
         for (int compIdx = 0; compIdx < numComponents; compIdx++)
         {
+            // Multiply row of main component (Raoult's Law) with 10e-5 (order of magn. of pressure)
             if (compIdx < numMajorComponents)
-            {
-                for (int colIdx = 0; colIdx < numPhases*numComponents; colIdx++)
-                {
-                    //Multiply row of main component (Raoult's Law) with 10e-5 (order of magn. of pressure)
-                    M[compIdx][colIdx] *= 10e-5;
-                }
-            } else {
-                for (int colIdx = 0; colIdx < numPhases*numComponents; colIdx++)
-                {
-                    //Multiply row of sec. components (Henry's Law) with 10e-9 (order of magn. of Henry constant)
-                    M[compIdx][colIdx] *= 10e-9;
-                }
-            }
-        }
+                M[compIdx] *= 10e-5;
 
+            // Multiply row of sec. components (Henry's Law) with 10e-9 (order of magn. of Henry constant)
+            else
+                M[compIdx] *= 10e-9;
+        }
 
         // solve for all mole fractions
-        try
-        {
-            M.solve(x, b);
-        }
+        try { M.solve(x, b); }
         catch (Dune::FMatrixError & e) {
             DUNE_THROW(NumericalProblem,
                     "Matrix for composition of phases could not be solved. \n"
diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh
index a3fa37132bab2de0ffb47d94459283cd94bceef8..5f09f7b147b7ccc7d26f4be2bd16ecd323fe57f2 100644
--- a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh
@@ -29,18 +29,12 @@
 
 namespace Dumux {
 
-struct SimpleLumpingIndices
-{
-    static const int wPhaseIdx = 0;
-    static const int nPhaseIdx = 1;
-};
-
 /*!
  * \ingroup Fluidmatrixinteractions
  * \brief   Relation for the saturation-dependent effective thermal conductivity
  * \todo This shouldn't depend on TypeTag!!
  */
-template<class Scalar, int numEnergyEquationsFluid, class Indices = SimpleLumpingIndices>
+template<class Scalar, int numEnergyEquationsFluid>
 class ThermalConductivitySimpleFluidLumping
 {
 
@@ -52,8 +46,8 @@ public:
      * \param spatialParams spatial parameters
      * \param element element (to be passed to spatialParams)
      * \param fvGeometry fvGeometry (to be passed to spatialParams)
-     * \param scvIdx scvIdx (to be passed to spatialParams)
-     *
+     * \param scv the sub-control volume
+     * \todo TODO: Fix this law for changing wettability
      * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$
      */
     template<class VolumeVariables, class SpatialParams, class Element, class FVGeometry, class SubControlVolume>
@@ -63,9 +57,10 @@ public:
                                                const FVGeometry& fvGeometry,
                                                SubControlVolume& scv)
     {
-        Scalar sw = volVars.saturation(Indices::wPhaseIdx);
-        Scalar lambdaW = volVars.fluidThermalConductivity(Indices::wPhaseIdx);
-        Scalar lambdaN = volVars.fluidThermalConductivity(Indices::nPhaseIdx);
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        Scalar sw = volVars.saturation(FluidSystem::phase0Idx);
+        Scalar lambdaW = volVars.fluidThermalConductivity(FluidSystem::phase0Idx);
+        Scalar lambdaN = volVars.fluidThermalConductivity(FluidSystem::phase1Idx);
         Scalar lambdaSolid = volVars.solidThermalConductivity();
         Scalar porosity = volVars.porosity();
 
diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh
index 7dd0bd3571e613e1df9e376485526c993a7c1faa..7fb5c8773119feeb91b0028a0ebb75448bf18847 100644
--- a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh
@@ -27,14 +27,7 @@
 #include <algorithm>
 #include <cmath>
 
-namespace Dumux
-{
-
-struct SomertonIndices
-{
-    static constexpr int wPhaseIdx = 0;
-    static constexpr int nPhaseIdx = 1;
-};
+namespace Dumux {
 
 /*!
  * \ingroup Fluidmatrixinteractions
@@ -62,7 +55,7 @@ struct SomertonIndices
  }\f$
  *
  */
-template<class Scalar, class Indices = SomertonIndices>
+template<class Scalar>
 class ThermalConductivitySomerton
 {
 public:
@@ -83,37 +76,44 @@ public:
      * fluid conductivities and interpolated with the square root of the wetting saturation.
      * See f.e. Ebigbo, A.: Thermal Effects of Carbon Dioxide Sequestration in the Subsurface, Diploma thesis \cite ebigbo2005 .
      */
-    template<class VolumeVariables, class SpatialParams, class Element, class FVGeometry, class SubControlVolume>
+    template<class VolumeVariables, class SpatialParams, class Element, class FVGeometry>
     static Scalar effectiveThermalConductivity(const VolumeVariables& volVars,
                                                const SpatialParams& spatialParams,
                                                const Element& element,
                                                const FVGeometry& fvGeometry,
-                                               const SubControlVolume& scv)
+                                               const typename FVGeometry::SubControlVolume& scv)
     {
-        const Scalar sw = volVars.saturation(Indices::wPhaseIdx);
-        const Scalar lambdaW = volVars.fluidThermalConductivity(Indices::wPhaseIdx);
-        const Scalar lambdaN = volVars.fluidThermalConductivity(Indices::nPhaseIdx);
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomerton only works for two-phase fluid systems!");
+        static_assert(!FluidSystem::isLiquid(0) || !FluidSystem::isLiquid(1), "ThermalConductivitySomerton only works if one phase is gaseous and one is liquid!");
+
+        constexpr int liquidPhaseIdx = FluidSystem::isLiquid(0) ? 0 : 1;
+        constexpr int gasPhaseIdx = FluidSystem::isLiquid(0) ? 1 : 0;
+
+        const Scalar satLiquid = volVars.saturation(liquidPhaseIdx);
+        const Scalar lambdaLiquid = volVars.fluidThermalConductivity(liquidPhaseIdx);
+        const Scalar lambdaGas = volVars.fluidThermalConductivity(gasPhaseIdx);
         const Scalar lambdaSolid = volVars.solidThermalConductivity();
         const Scalar porosity = volVars.porosity();
 
-        return effectiveThermalConductivity(sw, lambdaW, lambdaN, lambdaSolid, porosity);
+        return effectiveThermalConductivity(satLiquid, lambdaLiquid, lambdaGas, lambdaSolid, porosity);
     }
 
     /*!
      * \brief effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974 <BR>
      *
-     * \param sw The saturation of the wetting phase
-     * \param lambdaW The thermal conductivity of the wetting phase in \f$\mathrm{[W/(m K)]}\f$
-     * \param lambdaN The thermal conductivity of the non-wetting phase in \f$\mathrm{[W/(m K)]}\f$
+     * \param satLiquid The saturation of the liquid phase
+     * \param lambdaLiquid The thermal conductivity of the liquid phase in \f$\mathrm{[W/(m K)]}\f$
+     * \param lambdaGas The thermal conductivity of the gas phase in \f$\mathrm{[W/(m K)]}\f$
      * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{[W/(m K)]}\f$
      * \param porosity The porosity
      * \param rhoSolid The density of solid phase in \f$\mathrm{[kg/m^3]}\f$
      *
      * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974
      */
-    static Scalar effectiveThermalConductivity(const Scalar sw,
-                                               const Scalar lambdaW,
-                                               const Scalar lambdaN,
+    static Scalar effectiveThermalConductivity(const Scalar satLiquid,
+                                               const Scalar lambdaLiquid,
+                                               const Scalar lambdaGas,
                                                const Scalar lambdaSolid,
                                                const Scalar porosity,
                                                const Scalar rhoSolid = 0.0 /*unused*/)
@@ -121,13 +121,15 @@ public:
         using std::max;
         using std::pow;
         using std::sqrt;
-        const Scalar satW = max<Scalar>(0.0, sw);
+        const Scalar satLiquidPhysical = max<Scalar>(0.0, satLiquid);
         // geometric mean, using ls^(1-p)*l^p = ls*(l/ls)^p
-        const Scalar lSat = lambdaSolid * pow(lambdaW / lambdaSolid, porosity);
-        const Scalar lDry = lambdaSolid * pow(lambdaN / lambdaSolid, porosity);
+        const Scalar lSat = lambdaSolid * pow(lambdaLiquid / lambdaSolid, porosity);
+        const Scalar lDry = lambdaSolid * pow(lambdaGas / lambdaSolid, porosity);
 
-        return lDry + sqrt(satW) * (lSat - lDry);
+        return lDry + sqrt(satLiquidPhysical) * (lSat - lDry);
     }
 };
-}
+
+} // end namespace Dumux
+
 #endif
diff --git a/dumux/material/fluidmatrixinteractions/3p/thermalconductivitysomerton3p.hh b/dumux/material/fluidmatrixinteractions/3p/thermalconductivitysomerton3p.hh
index 00d95b8651a2350de17814afc690a18fced40329..3a9da9bdb9567866159652f88e279e2da3546d8f 100644
--- a/dumux/material/fluidmatrixinteractions/3p/thermalconductivitysomerton3p.hh
+++ b/dumux/material/fluidmatrixinteractions/3p/thermalconductivitysomerton3p.hh
@@ -27,15 +27,7 @@
 #include <algorithm>
 #include <cmath>
 
-namespace Dumux
-{
-
-struct SimpleThreePIndices
-{
-    static const int wPhaseIdx = 0;
-    static const int nPhaseIdx = 1;
-    static const int gPhaseIdx = 2;
-};
+namespace Dumux {
 
 /*!
  * \ingroup Fluidmatrixinteractions
@@ -68,7 +60,7 @@ struct SimpleThreePIndices
  \lambda_\text{g,eff} = \lambda_{solid}^{\left(1-\phi\right)}*\lambda_g^\phi.
  \f]
  */
-template<class Scalar, class Indices = SimpleThreePIndices>
+template<class Scalar>
 class ThermalConductivitySomerton
 {
 public:
@@ -88,18 +80,20 @@ public:
      * These two effective conductivities are computed as geometric mean of the solid and the
      * fluid conductivities and interpolated with the square root of the wetting saturation.
      */
-    template<class VolumeVariables, class SpatialParams, class Element, class FVGeometry, class SubControlVolume>
+    template<class VolumeVariables, class SpatialParams, class Element, class FVGeometry>
     static Scalar effectiveThermalConductivity(const VolumeVariables& volVars,
                                                const SpatialParams& spatialParams,
                                                const Element& element,
                                                const FVGeometry& fvGeometry,
-                                               const SubControlVolume& scv)
+                                               const typename FVGeometry::SubControlVolume& scv)
     {
-        Scalar sw = volVars.saturation(Indices::wPhaseIdx);
-        Scalar sn = volVars.saturation(Indices::nPhaseIdx);
-        Scalar lambdaW = volVars.fluidThermalConductivity(Indices::wPhaseIdx);
-        Scalar lambdaN = volVars.fluidThermalConductivity(Indices::nPhaseIdx);
-        Scalar lambdaG = volVars.fluidThermalConductivity(Indices::gPhaseIdx);
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
+        Scalar sw = volVars.saturation(FluidSystem::wPhaseIdx);
+        Scalar sn = volVars.saturation(FluidSystem::nPhaseIdx);
+        Scalar lambdaW = volVars.fluidThermalConductivity(FluidSystem::wPhaseIdx);
+        Scalar lambdaN = volVars.fluidThermalConductivity(FluidSystem::nPhaseIdx);
+        Scalar lambdaG = volVars.fluidThermalConductivity(FluidSystem::gPhaseIdx);
         Scalar lambdaSolid = volVars.solidThermalConductivity();
         Scalar porosity = volVars.porosity();
 
diff --git a/dumux/material/fluidstates/2p2c.hh b/dumux/material/fluidstates/2p2c.hh
index f69efa52319bcbbda4bee0ffd73c275644aad265..91d746422ef8cf8636d1c9c5c9a2b916c4768288 100644
--- a/dumux/material/fluidstates/2p2c.hh
+++ b/dumux/material/fluidstates/2p2c.hh
@@ -40,8 +40,8 @@ class TwoPTwoCFluidState
 {
 public:
     enum {
-        wPhaseIdx = FluidSystem::wPhaseIdx,
-        nPhaseIdx = FluidSystem::nPhaseIdx,
+        phase0Idx = FluidSystem::phase0Idx,
+        phase1Idx = FluidSystem::phase1Idx,
     };
 
     enum {  numPhases = FluidSystem::numPhases,
@@ -49,6 +49,13 @@ public:
     using PhaseVector = Dune::FieldVector<Scalar, numPhases>;
 
 public:
+
+    // comply with new style 2p2c models
+    int wettingPhase() const
+    {
+        return phase0Idx;
+    }
+
     /*!
      * \name access functions
      * \todo doc me!
@@ -65,7 +72,7 @@ public:
      */
     Scalar saturation(int phaseIdx) const
     {
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             return sw_;
         }
@@ -124,7 +131,7 @@ public:
      */
     Scalar partialPressure(int compIdx) const
     {
-        return partialPressure(nPhaseIdx, compIdx);
+        return partialPressure(phase1Idx, compIdx);
     }
 
     /*!
@@ -146,7 +153,7 @@ public:
      * \brief Returns the capillary pressure \f$\mathrm{[Pa]}\f$
      */
     Scalar capillaryPressure() const
-    { return phasePressure_[nPhaseIdx] - phasePressure_[wPhaseIdx]; }
+    { return phasePressure_[phase1Idx] - phasePressure_[phase0Idx]; }
 
     /*!
      * \brief The temperature within the domain \f$\mathrm{[K]}\f$
@@ -181,8 +188,8 @@ public:
       using std::isnan;
         if (isnan(nu_[phaseIdx]))  //in contrast to the standard update() method, satflash() does not calculate nu.
         {
-            nu_[wPhaseIdx] = sw_ * density_[wPhaseIdx] / (sw_ * density_[wPhaseIdx] + (1. - sw_) * density_[nPhaseIdx]);
-            nu_[nPhaseIdx] = 1. - nu_[wPhaseIdx];
+            nu_[phase0Idx] = sw_ * density_[phase0Idx] / (sw_ * density_[phase0Idx] + (1. - sw_) * density_[phase1Idx]);
+            nu_[phase1Idx] = 1. - nu_[phase0Idx];
             return nu_[phaseIdx];
         }
         return nu_[phaseIdx];
@@ -247,7 +254,7 @@ public:
      */
     void setSaturation(int phaseIdx, Scalar value)
     {
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
             sw_ = value;
         else
             sw_ = 1.-value;
diff --git a/dumux/material/fluidstates/compositional.hh b/dumux/material/fluidstates/compositional.hh
index 79d5198363b3bcfcdaf8e461d01cb0faaf5db213..2e065d34d191425cd8061f9d26d2ed559c3c6458 100644
--- a/dumux/material/fluidstates/compositional.hh
+++ b/dumux/material/fluidstates/compositional.hh
@@ -73,6 +73,14 @@ public:
      * Generic access to fluid properties (No assumptions
      * on thermodynamic equilibrium required)
      *****************************************************/
+    /*!
+     * \brief Returns the index of the wetting phase in the
+     *        fluid-solid configuration (for porous medium systems).
+     *
+     * \param phaseIdx the index of the phase
+     */
+    int wettingPhase() const { return wPhaseIdx_; }
+
     /*!
      * \brief Returns the saturation \f$S_\alpha\f$ of a fluid phase \f$\alpha\f$ in \f$\mathrm{[-]}\f$.
      *
@@ -293,6 +301,7 @@ public:
             viscosity_[phaseIdx] = fs.viscosity(phaseIdx);
         }
         temperature_ = fs.temperature(0);
+        wPhaseIdx_ = fs.wettingPhase();
     }
 
     /*!
@@ -427,6 +436,12 @@ public:
     void setViscosity(int phaseIdx, Scalar value)
     { viscosity_[phaseIdx] = value; }
 
+    /*!
+     * \brief Set the index of the wetting phase
+     */
+    void setWettingPhase(int phaseIdx)
+    { wPhaseIdx_ = phaseIdx; }
+
     /*!
      * \brief Make sure that all attributes are defined.
      *
@@ -467,6 +482,10 @@ protected:
     Scalar enthalpy_[numPhases];
     Scalar viscosity_[numPhases];
     Scalar temperature_;
+
+    // For porous medium flow models, here we ... the index of the wetting
+    // phase (needed for vapor pressure evaluation if kelvin equation is used)
+    int wPhaseIdx_{0};
 };
 
 } // end namespace Dumux
diff --git a/dumux/material/fluidstates/pseudo1p2c.hh b/dumux/material/fluidstates/pseudo1p2c.hh
index 97f2549fe5c81938310fe32973ffb53a94a469fb..6a6b716867a73378ae5e2dca5b59c1894d1b920a 100644
--- a/dumux/material/fluidstates/pseudo1p2c.hh
+++ b/dumux/material/fluidstates/pseudo1p2c.hh
@@ -48,11 +48,11 @@ public:
            numComponents = FluidSystem::numComponents
         };
     enum {
-        wPhaseIdx = FluidSystem::wPhaseIdx,
-        nPhaseIdx = FluidSystem::nPhaseIdx,
+        phase0Idx = FluidSystem::phase0Idx,
+        phase1Idx = FluidSystem::phase1Idx,
 
-        wCompIdx = FluidSystem::wPhaseIdx,
-        nCompIdx = FluidSystem::nPhaseIdx
+        comp0Idx = FluidSystem::comp0Idx,
+        comp1Idx = FluidSystem::comp1Idx
     };
 
 public:
@@ -90,7 +90,7 @@ public:
      */
     Scalar partialPressure(int compIdx) const
     {
-        return partialPressure(nPhaseIdx, compIdx);
+        return partialPressure(phase1Idx, compIdx);
     }
 
     /*!
@@ -145,7 +145,7 @@ public:
         }
 
 
-        if (compIdx == wPhaseIdx)
+        if (compIdx == phase0Idx)
             return massFractionWater_;
         else
             return 1.-massFractionWater_;
@@ -172,7 +172,7 @@ public:
                 return 0.;
         }
 
-        if (compIdx == wPhaseIdx)
+        if (compIdx == phase0Idx)
             return moleFractionWater_;
         else
             return 1.-moleFractionWater_;
@@ -260,7 +260,7 @@ public:
      */
     void setMassFraction(int phaseIdx, int compIdx, Scalar value)
     {
-        if (compIdx == wCompIdx)
+        if (compIdx == comp0Idx)
             massFractionWater_ = value;
         else
             massFractionWater_ = 1- value;
@@ -275,7 +275,7 @@ public:
      */
     void setMoleFraction(int phaseIdx, int compIdx, Scalar value)
     {
-        if (compIdx == wCompIdx)
+        if (compIdx == comp0Idx)
             moleFractionWater_ = value;
         else
             moleFractionWater_ = 1-value;
diff --git a/dumux/material/fluidsystems/1pgas.hh b/dumux/material/fluidsystems/1pgas.hh
index 57425a911109529f4653a1d5cae0bd48182a7cdd..1fec25b2523952da3027207a2ab37e5e73111308 100644
--- a/dumux/material/fluidsystems/1pgas.hh
+++ b/dumux/material/fluidsystems/1pgas.hh
@@ -32,11 +32,8 @@
 #include <dumux/material/fluidsystems/base.hh>
 #include <dumux/material/components/componenttraits.hh>
 
-namespace Dumux
-{
-
-namespace FluidSystems
-{
+namespace Dumux {
+namespace FluidSystems {
 
 /*!
  * \ingroup Fluidsystems
@@ -55,11 +52,11 @@ public:
     using Component = ComponentT;
     using ParameterCache = NullParameterCache;
 
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
-    static constexpr int numPhases = 1;
-    static constexpr int numComponents = 1;
+    static constexpr int numPhases = 1;  //!< Number of phases in the fluid system
+    static constexpr int numComponents = 1; //!< Number of components in the fluid system
+
+    static constexpr int phase0Idx = 0; //!< index of the only phase
+    static constexpr int comp0Idx = 0; //!< index of the only component
 
     /*!
      * \brief Initialize the fluid system's static parameters generically
@@ -67,6 +64,9 @@ public:
     static void init()
     { }
 
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
     /*!
      * \brief Return the human readable name of a fluid phase
      *
diff --git a/dumux/material/fluidsystems/1pliquid.hh b/dumux/material/fluidsystems/1pliquid.hh
index 96fa18d53ddaaa353246360143bd0b369b17930b..fce0b62962ffed276b308c1236d9b85d75abec07 100644
--- a/dumux/material/fluidsystems/1pliquid.hh
+++ b/dumux/material/fluidsystems/1pliquid.hh
@@ -32,10 +32,8 @@
 #include <dumux/material/fluidsystems/base.hh>
 #include <dumux/material/components/componenttraits.hh>
 
-namespace Dumux
-{
-namespace FluidSystems
-{
+namespace Dumux {
+namespace FluidSystems {
 
 /*!
  * \ingroup Fluidsystems
@@ -54,11 +52,11 @@ public:
     using Component = ComponentT;
     using ParameterCache = NullParameterCache;
 
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
-    static constexpr int numPhases = 1;
-    static constexpr int numComponents = 1;
+    static constexpr int numPhases = 1;  //!< Number of phases in the fluid system
+    static constexpr int numComponents = 1; //!< Number of components in the fluid system
+
+    static constexpr int phase0Idx = 0; //!< index of the only phase
+    static constexpr int comp0Idx = 0; //!< index of the only component
 
     /*!
      * \brief Initialize the fluid system's static parameters generically
@@ -66,6 +64,9 @@ public:
     static void init()
     { }
 
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
     /*!
      * \brief Return the human readable name of a fluid phase
      *
diff --git a/dumux/material/fluidsystems/2p1c.hh b/dumux/material/fluidsystems/2p1c.hh
index 2dbda768b069ea59c9599a6799ad804e9a9be3a0..1bdba48a6e4c9a4f7f343efb7b077f64058afda2 100644
--- a/dumux/material/fluidsystems/2p1c.hh
+++ b/dumux/material/fluidsystems/2p1c.hh
@@ -30,10 +30,6 @@
 
 #include <dune/common/exceptions.hh>
 
-#include <dumux/material/fluidsystems/1pliquid.hh>
-#include <dumux/material/fluidsystems/1pgas.hh>
-#include <dumux/material/fluidstates/compositional.hh>
-
 #include "base.hh"
 
 namespace Dumux {
@@ -51,17 +47,19 @@ class TwoPOneC
     using Component = ComponentType;
 
 public:
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
-
-    //! Number of phases in the fluid system
-    static constexpr int numPhases = 2;
+    static constexpr int numPhases = 2; //!< Number of phases in the fluid system
+    static constexpr int numComponents = 1; //!< Number of components in the fluid system
 
-    static constexpr int wPhaseIdx = 0; // index of the wetting phase
-    static constexpr int nPhaseIdx = 1; // index of the non-wetting phase
+    static constexpr int liquidPhaseIdx = 0; //!< index of the liquid phase
+    static constexpr int gasPhaseIdx = 1; //!< index of the gas phase
+    static constexpr int phase0Idx = liquidPhaseIdx; //!< index of the first phase
+    static constexpr int phase1Idx = gasPhaseIdx; //!< index of the second phase
 
+    static constexpr int comp0Idx = 0; //!< index of the only component
 
+    /****************************************
+    * Fluid phase related static parameters
+    ****************************************/
     /*!
      * \brief Return the human readable name of a fluid phase
      *
@@ -89,10 +87,10 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isLiquid(int phaseIdx)
+    static constexpr bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return phaseIdx == wPhaseIdx;
+        return phaseIdx == liquidPhaseIdx;
     }
 
     /*!
@@ -109,7 +107,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealMixture(int phaseIdx)
+    static constexpr bool isIdealMixture(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // we assume Henry's and Raoult's laws for the water phase and
@@ -131,7 +129,7 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // gases are always compressible
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == gasPhaseIdx)
             return true;
         // the component decides for the liquid phase...
         return Component::liquidIsCompressible();
@@ -143,11 +141,11 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealGas(int phaseIdx)
+    static constexpr bool isIdealGas(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == gasPhaseIdx)
             // let the components decide
             return Component::gasIsIdeal();
         return false; // not a gas
@@ -157,12 +155,6 @@ public:
      * Component related static parameters
      ****************************************/
 
-    //! Number of components in the fluid system
-    static constexpr int numComponents = 1;
-
-    static constexpr int ComponentIdx = 0;
-
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -291,10 +283,10 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
                 return Component::liquidDensity(T, p);
         }
-        else if (phaseIdx == nPhaseIdx)// gas phase
+        else if (phaseIdx == gasPhaseIdx)// gas phase
         {
             return Component::gasDensity(T, p);
         }
@@ -319,10 +311,10 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
                 return Component::liquidViscosity(T, p);
         }
-        else if (phaseIdx == nPhaseIdx) // gas phase
+        else if (phaseIdx == gasPhaseIdx) // gas phase
         {
             return Component::gasViscosity(T, p) ;
         }
@@ -341,7 +333,7 @@ public:
                                    const unsigned int phaseIdx)
     {
         assert(0 <= phaseIdx  && phaseIdx < numPhases);
-        Scalar pressure = fluidState.pressure(nPhaseIdx) ;
+        Scalar pressure = fluidState.pressure(gasPhaseIdx) ;
 
         return Component::vaporTemperature(pressure) ;
     }
@@ -386,7 +378,7 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == liquidPhaseIdx)
            return Component::vaporPressure(T)/p;
 
         // for the gas phase, assume an ideal gas when it comes to
@@ -449,11 +441,11 @@ public:
         assert(0 <= phaseIdx  && phaseIdx < numPhases);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             return Component::liquidEnthalpy(fluidState.temperature(phaseIdx),
                                            fluidState.pressure(phaseIdx));
         }
-        else if (phaseIdx == nPhaseIdx) // gas phase
+        else if (phaseIdx == gasPhaseIdx) // gas phase
         {
             return Component::gasEnthalpy(fluidState.temperature(phaseIdx),
                                            fluidState.pressure(phaseIdx));
@@ -477,11 +469,11 @@ public:
     {
         assert(0 <= phaseIdx  && phaseIdx < numPhases);
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
                  return Component::liquidThermalConductivity(fluidState.temperature(phaseIdx),
                                                         fluidState.pressure(phaseIdx)); //0.68 ;
         }
-        else if (phaseIdx == nPhaseIdx) // gas phase
+        else if (phaseIdx == gasPhaseIdx) // gas phase
         {
             return Component::gasThermalConductivity(fluidState.temperature(phaseIdx),
                                                         fluidState.pressure(phaseIdx)); //0.0248;
@@ -504,11 +496,11 @@ public:
     {
         assert(0 <= phaseIdx  && phaseIdx < numPhases);
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
                  return Component::liquidHeatCapacity(fluidState.temperature(phaseIdx),
                                            fluidState.pressure(phaseIdx));//4.217e3 ;
         }
-        else if (phaseIdx == nPhaseIdx) // gas phase
+        else if (phaseIdx == gasPhaseIdx) // gas phase
         {
             return Component::gasHeatCapacity(fluidState.temperature(phaseIdx),
                                            fluidState.pressure(phaseIdx));//2.029e3;
diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh
index c6e1f7501a197fca187ab26eb857f880eac88de2..db9c3cf2e7b93b35201b766871689cdf7787ebfd 100644
--- a/dumux/material/fluidsystems/2pimmiscible.hh
+++ b/dumux/material/fluidsystems/2pimmiscible.hh
@@ -45,38 +45,38 @@ namespace FluidSystems {
  *
  * The fluid phases are completely specified by means of their
  * constituting components.
- * The wetting and the non-wetting fluids can be defined individually
- * via FluidSystem::OnePLiquid<Scalar, Component> and
- * FluidSystem::OnePGas<Scalar, Component>. These fluids consist of one pure
- * component.
+ * The fluids can be defined individually via FluidSystem::OnePLiquid<Scalar, Component> and
+ * FluidSystem::OnePGas<Scalar, Component>. These fluids consist of one component.
  * \tparam Scalar the scalar type
- * \tparam WettingFluid the wetting phase fluid system (use FluidSystem::OnePLiquid<Scalar, Component> / FluidSystem::OnePGas<Scalar, Component>)
- * \tparam NonwettingFluid the wetting phase fluid system (use FluidSystem::OnePLiquid<Scalar, Component> / FluidSystem::OnePGas<Scalar, Component>)
+ * \tparam Fluid0 a one-phase fluid system (use FluidSystem::OnePLiquid<Scalar, Component> / FluidSystem::OnePGas<Scalar, Component>)
+ * \tparam Fluid1 a one-phase fluid system (use FluidSystem::OnePLiquid<Scalar, Component> / FluidSystem::OnePGas<Scalar, Component>)
  */
-template <class Scalar, class WettingFluid, class NonwettingFluid>
+template <class Scalar, class Fluid0, class Fluid1>
 class TwoPImmiscible
-: public BaseFluidSystem<Scalar, TwoPImmiscible<Scalar, WettingFluid, NonwettingFluid> >
+: public BaseFluidSystem<Scalar, TwoPImmiscible<Scalar, Fluid0, Fluid1> >
 {
-    static_assert((WettingFluid::numPhases == 1), "WettingFluid has more than one phase");
-    static_assert((NonwettingFluid::numPhases == 1), "NonwettingFluid has more than one phase");
-    static_assert((WettingFluid::numComponents == 1), "WettingFluid has more than one component");
-    static_assert((NonwettingFluid::numComponents == 1), "NonwettingFluid has more than one component");
-
-    using ThisType = TwoPImmiscible<Scalar, WettingFluid, NonwettingFluid>;
+    static_assert((Fluid0::numPhases == 1), "Fluid0 has more than one phase");
+    static_assert((Fluid1::numPhases == 1), "Fluid1 has more than one phase");
+    static_assert((Fluid0::numComponents == 1), "Fluid0 has more than one component");
+    static_assert((Fluid1::numComponents == 1), "Fluid1 has more than one component");
+    // two gaseous phases at once do not make sense physically! (but two liquids are fine)
+    static_assert(Fluid0::isLiquid() || Fluid1::isLiquid(), "One phase has to be a liquid!");
+
+    using ThisType = TwoPImmiscible<Scalar, Fluid0, Fluid1>;
     using Base = BaseFluidSystem<Scalar, ThisType>;
+
 public:
+    static constexpr int numPhases = 2; //!< Number of phases in the fluid system
+    static constexpr int numComponents = 2; //!< Number of components in the fluid system
+
+    static constexpr int phase0Idx = 0; //!< index of the first phase
+    static constexpr int phase1Idx = 1; //!< index of the second phase
+    static constexpr int comp0Idx = 0; //!< index of the frist component
+    static constexpr int comp1Idx = 1; //!< index of the second component
+
     /****************************************
      * Fluid phase related static parameters
      ****************************************/
-
-    //! Number of phases in the fluid system
-    static constexpr int numPhases = 2;
-
-    //! Index of the wetting phase
-    static constexpr int wPhaseIdx = 0;
-    //! Index of the non-wetting phase
-    static constexpr int nPhaseIdx = 1;
-
     /*!
      * \brief Return the human readable name of a fluid phase
      * \param phaseIdx The index of the fluid phase to consider
@@ -85,11 +85,10 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
-        static std::string name[] = {
-            std::string("w"),
-            std::string("n")
-        };
-        return name[phaseIdx];
+        if (phaseIdx == phase0Idx)
+            return Fluid0::phaseName();
+        else
+            return Fluid1::phaseName();
     }
 
     /*!
@@ -102,13 +101,13 @@ public:
      * \brief Return whether a phase is liquid
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isLiquid(int phaseIdx)
+    static constexpr bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::isLiquid();
-        return NonwettingFluid::isLiquid();
+        if (phaseIdx == phase0Idx)
+            return Fluid0::isLiquid();
+        return Fluid1::isLiquid();
     }
 
     /*!
@@ -132,6 +131,22 @@ public:
         return true;
     }
 
+    /*!
+     * \brief Returns true if and only if a fluid phase is assumed to
+     *        be an ideal gas.
+     *
+     * \param phaseIdx The index of the fluid phase to consider
+     */
+    static constexpr bool isIdealGas(int phaseIdx)
+    {
+        assert(0 <= phaseIdx && phaseIdx < numPhases);
+
+        // let the fluids decide
+        if (phaseIdx == phase0Idx)
+            return Fluid0::isIdealGas();
+        return Fluid1::isIdealGas();
+    }
+
     /*!
      * \brief Returns true if and only if a fluid phase is assumed to
      *        be compressible.
@@ -146,9 +161,24 @@ public:
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
         // let the fluids decide
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::isCompressible();
-        return NonwettingFluid::isCompressible();
+        if (phaseIdx == phase0Idx)
+            return Fluid0::isCompressible();
+        return Fluid1::isCompressible();
+    }
+
+    /*!
+     * \brief Returns true if the liquid phase viscostiy is constant
+     *
+     * \param phaseIdx The index of the fluid phase to consider
+     */
+    static constexpr bool viscosityIsConstant(int phaseIdx)
+    {
+        assert(0 <= phaseIdx && phaseIdx < numPhases);
+
+        // let the fluids decide
+        if (phaseIdx == phase0Idx)
+            return Fluid0::viscosityIsConstant();
+        return Fluid1::viscosityIsConstant();
     }
 
     /*!
@@ -157,28 +187,19 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealGas(int phaseIdx)
+    static bool isIdealFluid1(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
         // let the fluids decide
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::isIdealGas();
-        return NonwettingFluid::isIdealGas();
+        if (phaseIdx == phase0Idx)
+            return Fluid0::isIdealFluid1();
+        return Fluid1::isIdealFluid1();
     }
 
     /****************************************
      * Component related static parameters
      ****************************************/
-
-    //! Number of components in the fluid system
-    static constexpr int numComponents = 2;
-
-    //! Index of the wetting phase's component
-    static constexpr int wCompIdx = 0;
-    //! Index of the non-wetting phase's component
-    static constexpr int nCompIdx = 1;
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -188,9 +209,9 @@ public:
     {
         assert(0 <= compIdx && compIdx < numComponents);
 
-        if (compIdx == wCompIdx)
-            return WettingFluid::name();
-        return NonwettingFluid::name();
+        if (compIdx == comp0Idx)
+            return Fluid0::name();
+        return Fluid1::name();
     }
 
     /*!
@@ -201,9 +222,9 @@ public:
     {
         assert(0 <= compIdx && compIdx < numComponents);
 
-        if (compIdx == wCompIdx)
-            return WettingFluid::molarMass();
-        return NonwettingFluid::molarMass();
+        if (compIdx == comp0Idx)
+            return Fluid0::molarMass();
+        return Fluid1::molarMass();
     }
 
     /*!
@@ -214,9 +235,9 @@ public:
     {
         assert(0 <= compIdx && compIdx < numComponents);
 
-        if (compIdx == wCompIdx)
-            return WettingFluid::criticalTemperature();
-        return NonwettingFluid::criticalTemperature();
+        if (compIdx == comp0Idx)
+            return Fluid0::criticalTemperature();
+        return Fluid1::criticalTemperature();
     }
 
     /*!
@@ -227,9 +248,9 @@ public:
     {
         assert(0 <= compIdx && compIdx < numComponents);
 
-        if (compIdx == wCompIdx)
-            return WettingFluid::criticalPressure();
-        return NonwettingFluid::criticalPressure();
+        if (compIdx == comp0Idx)
+            return Fluid0::criticalPressure();
+        return Fluid1::criticalPressure();
     }
 
     /*!
@@ -240,9 +261,9 @@ public:
     {
         assert(0 <= compIdx && compIdx < numComponents);
 
-        if (compIdx == wCompIdx)
-            return WettingFluid::acentricFactor();
-        return NonwettingFluid::acentricFactor();
+        if (compIdx == comp0Idx)
+            return Fluid0::acentricFactor();
+        return Fluid1::acentricFactor();
     }
 
     /****************************************
@@ -253,11 +274,7 @@ public:
      * \brief Initialize the fluid system's static parameters
      */
     static void init()
-    {
-        // two gaseous phases at once do not make sense physically!
-        // (But two liquids are fine)
-        assert(WettingFluid::isLiquid() || NonwettingFluid::isLiquid());
-    }
+    {}
 
     using Base::density;
     /*!
@@ -272,9 +289,9 @@ public:
 
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::density(temperature, pressure);
-        return NonwettingFluid::density(temperature, pressure);
+        if (phaseIdx == phase0Idx)
+            return Fluid0::density(temperature, pressure);
+        return Fluid1::density(temperature, pressure);
     }
 
     using Base::viscosity;
@@ -291,9 +308,9 @@ public:
 
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::viscosity(temperature, pressure);
-        return NonwettingFluid::viscosity(temperature, pressure);
+        if (phaseIdx == phase0Idx)
+            return Fluid0::viscosity(temperature, pressure);
+        return Fluid1::viscosity(temperature, pressure);
     }
 
     using Base::fugacityCoefficient;
@@ -399,9 +416,9 @@ public:
 
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::enthalpy(temperature, pressure);
-        return NonwettingFluid::enthalpy(temperature, pressure);
+        if (phaseIdx == phase0Idx)
+            return Fluid0::enthalpy(temperature, pressure);
+        return Fluid1::enthalpy(temperature, pressure);
     }
 
     using Base::thermalConductivity;
@@ -418,9 +435,9 @@ public:
 
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::thermalConductivity(temperature, pressure);
-        return NonwettingFluid::thermalConductivity(temperature, pressure);
+        if (phaseIdx == phase0Idx)
+            return Fluid0::thermalConductivity(temperature, pressure);
+        return Fluid1::thermalConductivity(temperature, pressure);
     }
 
     using Base::heatCapacity;
@@ -443,9 +460,9 @@ public:
 
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
-            return WettingFluid::heatCapacity(temperature, pressure);
-        return NonwettingFluid::heatCapacity(temperature, pressure);
+        if (phaseIdx == phase0Idx)
+            return Fluid0::heatCapacity(temperature, pressure);
+        return Fluid1::heatCapacity(temperature, pressure);
     }
 };
 
diff --git a/dumux/material/fluidsystems/brineair.hh b/dumux/material/fluidsystems/brineair.hh
index ed3871ae00311acd683f1d8e8d0647e2b7317479..ca54b4ba99799ceaff055fb9e6f062a38f5ded47 100644
--- a/dumux/material/fluidsystems/brineair.hh
+++ b/dumux/material/fluidsystems/brineair.hh
@@ -60,13 +60,12 @@ class BrineAir
     using IdealGas = Dumux::IdealGas<Scalar>;
 
 public:
-
     using H2O = H2Otype;
+    using Air = Components::Air<Scalar>;
+    using Brine = Components::Brine<Scalar, H2Otype>;
+    using NaCl = Components::NaCl<Scalar>;
     using H2O_Air = BinaryCoeff::H2O_Air;
-    using Air = Dumux::Components::Air<Scalar>;
     using Brine_Air = BinaryCoeff::Brine_Air<Scalar, Air>;
-    using Brine = Dumux::Components::Brine<Scalar,H2Otype>;
-    using NaCl = Dumux::Components::NaCl<Scalar>;
 
     // the type of parameter cache objects. this fluid system does not
     using ParameterCache = NullParameterCache;
@@ -74,20 +73,25 @@ public:
     /****************************************
      * Fluid phase related static parameters
      ****************************************/
-    static const int numSecComponents = 0; //needed to set property not used for 2pncMin model
-    static const int numPhases = 2; // liquid and gas phases
-    static const int numSPhases = 1;// precipitated solid phases
-    static const int lPhaseIdx = 0; // index of the liquid phase
-    static const int gPhaseIdx = 1; // index of the gas phase
-    static const int sPhaseIdx = 2; // index of the precipitated salt
-    static const int wPhaseIdx = lPhaseIdx; // index of the wetting phase
-    static const int nPhaseIdx = gPhaseIdx; // index of the non-wetting phase
+    static constexpr int numPhases = 2; // liquid and gas phases
+    static constexpr int numComponents = 3; // H2O, Air, NaCl
+    static constexpr int numSPhases = 1;// precipitated solid phases // TODO: remove
+
+    static constexpr int liquidPhaseIdx = 0; // index of the liquid phase
+    static constexpr int gasPhaseIdx = 1; // index of the gas phase
+    static constexpr int solidPhaseIdx = 2; // index of the precipitated salt // TODO: remove
+
+    static constexpr int phase0Idx = liquidPhaseIdx; // index of the first phase
+    static constexpr int phase1Idx = gasPhaseIdx; // index of the second phase
 
     // export component indices to indicate the main component
     // of the corresponding phase at atmospheric pressure 1 bar
     // and room temperature 20°C:
-    static const int wCompIdx = wPhaseIdx;
-    static const int nCompIdx = nPhaseIdx;
+    static constexpr int H2OIdx = 0;
+    static constexpr int AirIdx = 1;
+    static constexpr int comp0Idx = H2OIdx;
+    static constexpr int comp1Idx = AirIdx;
+    static constexpr int NaClIdx  = 2; // TODO: remove
 
     /*!
      * \brief Return the human readable name of a fluid phase
@@ -97,9 +101,9 @@ public:
     static std::string phaseName(int phaseIdx)
     {
         switch (phaseIdx) {
-        case wPhaseIdx: return "liquid";
-        case nPhaseIdx: return "gas";
-        case sPhaseIdx: return "NaCl";
+        case phase0Idx: return "liquid";
+        case phase1Idx: return "gas";
+        case solidPhaseIdx: return "NaCl";
         }
         DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
     }
@@ -119,7 +123,7 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
-        return phaseIdx != nPhaseIdx;
+        return phaseIdx != phase1Idx;
     }
 
     /*!
@@ -159,7 +163,7 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // ideal gases are always compressible
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == phase1Idx)
             return true;
         // the water component decides for the liquid phase...
         return H2O::liquidIsCompressible();
@@ -176,7 +180,7 @@ public:
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
         // let the fluids decide
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == phase1Idx)
             return H2O::gasIsIdeal() && Air::gasIsIdeal();
         return false; // not a gas
     }
@@ -184,13 +188,6 @@ public:
     /****************************************
      * Component related static parameters
      ****************************************/
-    static const int numComponents = 3; // H2O, Air, NaCl
-    static const int numMajorComponents = 2;// H2O, Air
-
-    static const int H2OIdx = wCompIdx;//0
-    static const int AirIdx = nCompIdx;//1
-    static const int NaClIdx  = 2;
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -230,8 +227,8 @@ public:
      */
     static Scalar precipitateDensity(int phaseIdx)
     {
-        if(phaseIdx != sPhaseIdx)
-            DUNE_THROW(Dune::InvalidStateException, "Invalid solid phase index " << sPhaseIdx);
+        if(phaseIdx != solidPhaseIdx)
+            DUNE_THROW(Dune::InvalidStateException, "Invalid solid phase index " << solidPhaseIdx);
         return NaCl::density();
     }
 
@@ -338,14 +335,14 @@ public:
         Scalar pressure = fluidState.pressure(phaseIdx);
 
         switch (phaseIdx) {
-            case lPhaseIdx:
+            case liquidPhaseIdx:
                 return Brine::liquidDensity(temperature,
                               pressure,
-                              fluidState.massFraction(lPhaseIdx, NaClIdx));
-            case gPhaseIdx:
+                              fluidState.massFraction(liquidPhaseIdx, NaClIdx));
+            case gasPhaseIdx:
                 return gasDensity_(temperature,
                             pressure,
-                            fluidState.moleFraction(gPhaseIdx, H2OIdx));
+                            fluidState.moleFraction(gasPhaseIdx, H2OIdx));
 
             default:
                 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
@@ -374,12 +371,12 @@ public:
         Scalar pressure = fluidState.pressure(phaseIdx);
         Scalar result = 0;
 
-        if (phaseIdx == lPhaseIdx)
+        if (phaseIdx == liquidPhaseIdx)
         {
-            Scalar XNaCl = fluidState.massFraction(lPhaseIdx, NaClIdx);
+            Scalar XNaCl = fluidState.massFraction(liquidPhaseIdx, NaClIdx);
             result = Brine::liquidViscosity(temperature, pressure, XNaCl);
         }
-        else if (phaseIdx == gPhaseIdx)
+        else if (phaseIdx == gasPhaseIdx)
         {
             result = Air::gasViscosity(temperature, pressure);
         }
@@ -425,10 +422,10 @@ public:
         assert(T > 0);
         assert(p > 0);
 
-        if (phaseIdx == gPhaseIdx)
+        if (phaseIdx == gasPhaseIdx)
             return 1.0;
 
-        else if (phaseIdx == lPhaseIdx)
+        else if (phaseIdx == liquidPhaseIdx)
         {
         if (compIdx == H2OIdx)
             return Brine::vaporPressure(T)/p;
@@ -441,15 +438,6 @@ public:
         DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
     }
 
-    template <class FluidState>
-    static Scalar kelvinVaporPressure(const FluidState &fluidState,
-                                      const int phaseIdx,
-                                      const int compIdx)
-    {
-        DUNE_THROW(Dune::NotImplemented, "FluidSystems::BrineAir::kelvinVaporPressure()");
-    }
-
-
     using Base::diffusionCoefficient;
     template <class FluidState>
     static Scalar diffusionCoefficient(const FluidState &fluidState,
@@ -483,7 +471,7 @@ public:
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == lPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             Scalar result = 0.0;
             if(compJIdx == AirIdx)
                 result = Brine_Air::liquidDiffCoeff(temperature, pressure);
@@ -497,7 +485,7 @@ public:
             return result;
         }
         else {
-            assert(phaseIdx == gPhaseIdx);
+            assert(phaseIdx == gasPhaseIdx);
 
             if (compIIdx != AirIdx)
             {
@@ -548,7 +536,7 @@ public:
         Scalar T = fluidState.temperature(phaseIdx);
         Scalar p = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == lPhaseIdx)
+        if (phaseIdx == liquidPhaseIdx)
         {
             Scalar XlNaCl = fluidState.massFraction(phaseIdx, NaClIdx);
             Scalar result = Brine::liquidEnthalpy(T, p, XlNaCl);
@@ -557,8 +545,8 @@ public:
         }
         else
         {
-            Scalar XAir = fluidState.massFraction(gPhaseIdx, AirIdx);
-            Scalar XH2O = fluidState.massFraction(gPhaseIdx, H2OIdx);
+            Scalar XAir = fluidState.massFraction(gasPhaseIdx, AirIdx);
+            Scalar XH2O = fluidState.massFraction(gasPhaseIdx, H2OIdx);
 
             Scalar result = 0;
             result += XH2O * H2O::gasEnthalpy(T, p);
@@ -579,16 +567,16 @@ public:
                                     int phaseIdx,
                                     int componentIdx)
     {
-        Scalar T = fluidState.temperature(nPhaseIdx);
-        Scalar p = fluidState.pressure(nPhaseIdx);
+        Scalar T = fluidState.temperature(phase1Idx);
+        Scalar p = fluidState.pressure(phase1Idx);
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
 
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             DUNE_THROW(Dune::NotImplemented, "The component enthalpies in the liquid phase are not implemented.");
         }
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
             if (componentIdx ==  H2OIdx)
             {
@@ -618,7 +606,7 @@ public:
     static Scalar thermalConductivity(const FluidState &fluidState,
                                       int phaseIdx)
     {
-        if (phaseIdx == lPhaseIdx)
+        if (phaseIdx == liquidPhaseIdx)
             return H2O::liquidThermalConductivity(fluidState.temperature(phaseIdx),
                                                   fluidState.pressure(phaseIdx));
         else // gas phase
@@ -643,14 +631,14 @@ public:
     {
         const Scalar temperature  = fluidState.temperature(phaseIdx);
         const Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             return H2O::liquidHeatCapacity(temperature, pressure);
         }
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
-            return Air::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(nPhaseIdx, AirIdx)
-                   + H2O::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(nPhaseIdx, H2OIdx);
+            return Air::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(phase1Idx, AirIdx)
+                   + H2O::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(phase1Idx, H2OIdx);
         }
         else
             DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
diff --git a/dumux/material/fluidsystems/brineco2.hh b/dumux/material/fluidsystems/brineco2.hh
index 81d2be0181d109480363b36efa0356a0a8a78270..c63188902bab4ba31a2824efc0e466c1bc534e1b 100644
--- a/dumux/material/fluidsystems/brineco2.hh
+++ b/dumux/material/fluidsystems/brineco2.hh
@@ -66,17 +66,20 @@ public:
     using Brine = Brinetype;
     using CO2 = Dumux::Components::CO2<Scalar, CO2Table>;
 
-    static const int numComponents = 2;
-    static const int numPhases = 2;
-
-    static const int wPhaseIdx = 0; // index of the liquid phase
-    static const int nPhaseIdx = 1; // index of the gas phase
-    static const int wCompIdx = 0;
-    static const int nCompIdx = 1;
-    static const int lCompIdx = wCompIdx;
-    static const int gCompIdx = nCompIdx;
-    static const int BrineIdx = wCompIdx;
-    static const int CO2Idx = nCompIdx;
+    static constexpr int numComponents = 2;
+    static constexpr int numPhases = 2;
+
+    static constexpr int phase0Idx = 0; // index of the first phase
+    static constexpr int phase1Idx = 1; // index of the second phase
+
+    static constexpr int comp0Idx = 0;
+    static constexpr int comp1Idx = 1;
+
+    static constexpr int liquidPhaseIdx = phase0Idx;
+    static constexpr int gasPhaseIdx = phase1Idx;
+
+    static constexpr int BrineIdx = comp0Idx;
+    static constexpr int CO2Idx = comp1Idx;
 
     /*!
      * \brief Return the human readable name of a fluid phase
@@ -105,11 +108,11 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isLiquid(int phaseIdx)
+    static constexpr bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
-        return phaseIdx != nPhaseIdx;
+        return phaseIdx != phase1Idx;
     }
 
     /*!
@@ -262,14 +265,14 @@ public:
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             // use normalized composition for to calculate the density
             // (the relations don't seem to take non-normalized
             // compositions too well...)
             using std::min;
             using std::max;
-            Scalar xlBrine = min(1.0, max(0.0, fluidState.moleFraction(wPhaseIdx, BrineIdx)));
-            Scalar xlCO2 = min(1.0, max(0.0, fluidState.moleFraction(wPhaseIdx, CO2Idx)));
+            Scalar xlBrine = min(1.0, max(0.0, fluidState.moleFraction(phase0Idx, BrineIdx)));
+            Scalar xlCO2 = min(1.0, max(0.0, fluidState.moleFraction(phase0Idx, CO2Idx)));
             Scalar sumx = xlBrine + xlCO2;
             xlBrine /= sumx;
             xlCO2 /= sumx;
@@ -283,15 +286,15 @@ public:
             return result;
         }
         else {
-            assert(phaseIdx == nPhaseIdx);
+            assert(phaseIdx == phase1Idx);
 
             // use normalized composition for to calculate the density
             // (the relations don't seem to take non-normalized
             // compositions too well...)
             using std::min;
             using std::max;
-            Scalar xgBrine = min(1.0, max(0.0, fluidState.moleFraction(nPhaseIdx, BrineIdx)));
-            Scalar xgCO2 = min(1.0, max(0.0, fluidState.moleFraction(nPhaseIdx, CO2Idx)));
+            Scalar xgBrine = min(1.0, max(0.0, fluidState.moleFraction(phase1Idx, BrineIdx)));
+            Scalar xgCO2 = min(1.0, max(0.0, fluidState.moleFraction(phase1Idx, CO2Idx)));
             Scalar sumx = xgBrine + xgCO2;
             xgBrine /= sumx;
             xgCO2 /= sumx;
@@ -326,7 +329,7 @@ public:
         Scalar pressure = fluidState.pressure(phaseIdx);
         Scalar result = 0;
 
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
             result = Brine::liquidViscosity(temperature, pressure);
         else
             result = CO2::gasViscosity(temperature, pressure);
@@ -370,7 +373,7 @@ public:
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         assert(0 <= compIdx && compIdx < numComponents);
 
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == phase1Idx)
             // use the fugacity coefficients of an ideal gas. the
             // actual value of the fugacity is not relevant, as long
             // as the relative fluid compositions are observed,
@@ -388,7 +391,7 @@ public:
         Brine_CO2::calculateMoleFractions(temperature,
                                           pressure,
                                           BrineRawComponent::salinity,
-                                          /*knownPhaseIdx=*/-1,
+                                          /*knowphase1Idx=*/-1,
                                           xlCO2,
                                           xgH2O);
 
@@ -439,11 +442,11 @@ public:
         Brine_CO2::calculateMoleFractions(temperature,
                                                   pressure,
                                                   BrineRawComponent::constantSalinity,
-                                                  /*knownPhaseIdx=*/-1,
+                                                  /*knowphase1Idx=*/-1,
                                                   xlCO2,
                                                   xgH2O);
 
-        if(phaseIdx == nPhaseIdx)
+        if(phaseIdx == phase1Idx)
         {
             return xgH2O;
         }
@@ -515,7 +518,7 @@ public:
 
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             assert(compIIdx == BrineIdx);
             assert(compJIdx == CO2Idx);
 
@@ -524,7 +527,7 @@ public:
             return result;
         }
         else {
-            assert(phaseIdx == nPhaseIdx);
+            assert(phaseIdx == phase1Idx);
             assert(compIIdx == BrineIdx);
             assert(compJIdx == CO2Idx);
 
@@ -550,7 +553,7 @@ public:
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             Scalar XlCO2 = fluidState.massFraction(phaseIdx, CO2Idx);
 
             Scalar result = liquidEnthalpyBrineCO2_(temperature,
@@ -564,10 +567,10 @@ public:
             Scalar result = 0;
             result +=
                 Brine::gasEnthalpy(temperature, pressure) *
-                fluidState.massFraction(nPhaseIdx, BrineIdx);
+                fluidState.massFraction(phase1Idx, BrineIdx);
             result +=
                 CO2::gasEnthalpy(temperature, pressure) *
-                fluidState.massFraction(nPhaseIdx, CO2Idx);
+                fluidState.massFraction(phase1Idx, CO2Idx);
             Valgrind::CheckDefined(result);
             return result;
         }
@@ -587,7 +590,7 @@ public:
     static Scalar thermalConductivity(const FluidState &fluidState,
                                       int phaseIdx)
     {
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             return H2O::liquidThermalConductivity(fluidState.temperature(phaseIdx),
                                                   fluidState.pressure(phaseIdx));
@@ -612,7 +615,7 @@ public:
     static Scalar heatCapacity(const FluidState &fluidState,
                                int phaseIdx)
     {
-        if(phaseIdx == wPhaseIdx)
+        if(phaseIdx == phase0Idx)
             return H2O::liquidHeatCapacity(fluidState.temperature(phaseIdx),
                                            fluidState.pressure(phaseIdx));
         else
diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh
index 2fad865ceda666fd6395268fa635edd0c126972e..77d5b173610f1fdce75a7088c5720f618540873e 100644
--- a/dumux/material/fluidsystems/h2oair.hh
+++ b/dumux/material/fluidsystems/h2oair.hh
@@ -54,7 +54,8 @@ namespace FluidSystems {
  */
 template <class Scalar,
           class H2Otype = Components::TabulatedComponent<Components::H2O<Scalar> >,
-          bool useComplexRelations = true>
+          bool useComplexRelations = true,
+          bool useKelvinVaporPressure = false>
 class H2OAir
 : public BaseFluidSystem<Scalar, H2OAir<Scalar, H2Otype, useComplexRelations> >
 {
@@ -66,16 +67,20 @@ public:
     using H2O = H2Otype;
     using Air = Dumux::Components::Air<Scalar>;
 
-    static constexpr int numPhases = 2;
+    static constexpr int numPhases = 2; //!< Number of phases in the fluid system
+    static constexpr int numComponents = 2; //!< Number of components in the fluid system
 
-    static constexpr int wPhaseIdx = 0; // index of the water phase
-    static constexpr int nPhaseIdx = 1; // index of the air phase
+    static constexpr int liquidPhaseIdx = 0; //!< index of the first phase
+    static constexpr int gasPhaseIdx = 1; //!< index of the second phase
+    static constexpr int phase0Idx = liquidPhaseIdx; //!< index of the first phase
+    static constexpr int phase1Idx = gasPhaseIdx; //!< index of the second phase
 
-    // export component indices to indicate the main component
-    // of the corresponding phase at atmospheric pressure 1 bar
-    // and room temperature 20°C:
-    static const int wCompIdx = wPhaseIdx;
-    static const int nCompIdx = nPhaseIdx;
+    static constexpr int H2OIdx = 0; //!< index of the frist component
+    static constexpr int AirIdx = 1; //!< index of the second component
+    static constexpr int comp0Idx = H2OIdx; //!< index of the frist component
+    static constexpr int comp1Idx = AirIdx; //!< index of the second component
+    static constexpr int liquidCompIdx = H2OIdx; //!< index of the liquid component
+    static constexpr int gasCompIdx = AirIdx; //!< index of the gas component
 
     /*!
      * \brief Return the human readable name of a phase
@@ -85,8 +90,8 @@ public:
     static std::string phaseName(int phaseIdx)
     {
         switch (phaseIdx) {
-        case wPhaseIdx: return "liquid";
-        case nPhaseIdx: return "gas";
+        case phase0Idx: return "liquid";
+        case phase1Idx: return "gas";
         }
         DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
     }
@@ -102,10 +107,10 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isLiquid(int phaseIdx)
+    static constexpr bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return phaseIdx != nPhaseIdx;
+        return phaseIdx != phase1Idx;
     }
 
     /*!
@@ -113,10 +118,10 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isGas(int phaseIdx)
+    static constexpr bool isGas(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return phaseIdx == nPhaseIdx;
+        return phaseIdx == phase1Idx;
     }
 
     /*!
@@ -133,7 +138,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealMixture(int phaseIdx)
+    static constexpr bool isIdealMixture(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // we assume Henry's and Raoult's laws for the water phase and
@@ -155,7 +160,7 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // ideal gases are always compressible
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == phase1Idx)
             return true;
         // the water component decides for the liquid phase...
         return H2O::liquidIsCompressible();
@@ -167,12 +172,12 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealGas(int phaseIdx)
+    static constexpr bool isIdealGas(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
         // let the fluids decide
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == phase1Idx)
             return H2O::gasIsIdeal() && Air::gasIsIdeal();
         return false; // not a gas
     }
@@ -180,13 +185,6 @@ public:
     /****************************************
      * Component related static parameters
      ****************************************/
-
-    //! Number of components in the fluid system
-    static constexpr int numComponents = 2;
-
-    static constexpr int H2OIdx = wCompIdx;
-    static constexpr int AirIdx = nCompIdx;
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -260,36 +258,25 @@ public:
     static Scalar vaporPressure(const FluidState &fluidState, int compIdx)
     {
         if (compIdx == H2OIdx)
-            return H2O::vaporPressure(fluidState.temperature());
+        {
+            const auto t = fluidState.temperature(H2OIdx);
+            if (!useKelvinVaporPressure)
+                return H2O::vaporPressure(t);
+            else
+            {
+                const auto pc = (fluidState.wettingPhase() == H2OIdx)
+                                 ? fluidState.pressure(AirIdx)-fluidState.pressure(H2OIdx)
+                                 : fluidState.pressure(H2OIdx)-fluidState.pressure(AirIdx);
+                return H2O::vaporPressure(t)*exp( -pc * molarMass(H2OIdx)
+                                                      / density(fluidState, H2OIdx)
+                                                      / (Dumux::Constants<Scalar>::R*t) );
+            }
+        }
         else if (compIdx == AirIdx)
-            return Air::vaporPressure(fluidState.temperature());
+            // return Air::vaporPressure(fluidState.temperature(AirIdx));
+            DUNE_THROW(Dune::NotImplemented, "Air::vaporPressure(t)");
         else
-             DUNE_THROW(Dune::NotImplemented, "Invalid component index " << compIdx);
-    }
-
-    /*!
-     * \brief Vapor pressure including the Kelvin equation in \f$\mathrm{[Pa]}\f$
-     *
-     * Calculate the decreased vapor pressure due to capillarity
-     *
-     * \param fluidState An abitrary fluid state
-     * \param phaseIdx The index of the fluid phase to consider
-     * \param compIdx The index of the component to consider
-     */
-    template <class FluidState>
-    static Scalar kelvinVaporPressure(const FluidState &fluidState,
-                                      const int phaseIdx,
-                                      const int compIdx)
-    {
-        assert(compIdx == wCompIdx && phaseIdx == wPhaseIdx);
-
-        using std::exp;
-        return fugacityCoefficient(fluidState, phaseIdx, compIdx)
-               * fluidState.pressure(phaseIdx)
-               * exp(-(fluidState.pressure(nPhaseIdx)-fluidState.pressure(wPhaseIdx))
-                          / density(fluidState, phaseIdx)
-                          / (Dumux::Constants<Scalar>::R / molarMass(compIdx))
-                          / fluidState.temperature());
+            DUNE_THROW(Dune::NotImplemented, "Invalid component index " << compIdx);
     }
 
     /*!
@@ -396,7 +383,7 @@ public:
         for (int compIdx = 0; compIdx < numComponents; ++compIdx)
             sumMoleFrac += fluidState.moleFraction(phaseIdx, compIdx);
 
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             if (!useComplexRelations)
                 // assume pure water
@@ -409,25 +396,25 @@ public:
 
                 return
                     clH2O
-                    * (H2O::molarMass()*fluidState.moleFraction(wPhaseIdx, H2OIdx)
+                    * (H2O::molarMass()*fluidState.moleFraction(phase0Idx, H2OIdx)
                            +
-                           Air::molarMass()*fluidState.moleFraction(wPhaseIdx, AirIdx))
+                           Air::molarMass()*fluidState.moleFraction(phase0Idx, AirIdx))
                    / sumMoleFrac;
             }
         }
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
             using std::max;
             if (!useComplexRelations)
                 // for the gas phase assume an ideal gas
                 return
                     IdealGas::molarDensity(T, p)
-                    * fluidState.averageMolarMass(nPhaseIdx)
+                    * fluidState.averageMolarMass(phase1Idx)
                     / max(1e-5, sumMoleFrac);
 
             return
-                H2O::gasDensity(T, fluidState.partialPressure(nPhaseIdx, H2OIdx)) +
-                Air::gasDensity(T, fluidState.partialPressure(nPhaseIdx, AirIdx));
+                H2O::gasDensity(T, fluidState.partialPressure(phase1Idx, H2OIdx)) +
+                Air::gasDensity(T, fluidState.partialPressure(phase1Idx, AirIdx));
         }
         DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
     }
@@ -455,12 +442,12 @@ public:
         Scalar T = fluidState.temperature(phaseIdx);
         Scalar p = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             // assume pure water for the liquid phase
             return H2O::liquidViscosity(T, p);
         }
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
             if(!useComplexRelations){
                 return Air::gasViscosity(T, p);
@@ -530,9 +517,9 @@ public:
         Scalar T = fluidState.temperature(phaseIdx);
         Scalar p = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             if (compIdx == H2OIdx)
-                return H2O::vaporPressure(T)/p;
+                return vaporPressure(fluidState, compIdx)/p;
             return BinaryCoeff::H2O_Air::henry(T)/p;
         }
 
@@ -550,8 +537,8 @@ public:
     template <class FluidState>
     static Scalar relativeHumidity(const FluidState &fluidState)
     {
-        return fluidState.partialPressure(nPhaseIdx, wCompIdx)
-               / H2O::vaporPressure(fluidState.temperature(nPhaseIdx));
+        return fluidState.partialPressure(phase1Idx, comp0Idx)
+               / H2O::vaporPressure(fluidState.temperature(phase1Idx));
     }
 
     using Base::diffusionCoefficient;
@@ -603,7 +590,7 @@ public:
 
         switch (phaseIdx)
         {
-        case wPhaseIdx:
+        case phase0Idx:
             switch (compIIdx) {
             case H2OIdx:
                 switch (compJIdx) {
@@ -616,7 +603,7 @@ public:
                            "Binary diffusion coefficients of trace "
                            "substances in liquid phase is undefined!\n");
             }
-        case nPhaseIdx:
+        case phase1Idx:
             switch (compIIdx){
             case H2OIdx:
                 switch (compJIdx){
@@ -660,21 +647,21 @@ public:
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
 
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             return H2O::liquidEnthalpy(T, p);
         }
 
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
             Scalar result = 0.0;
             result +=
                 H2O::gasEnthalpy(T, p) *
-                fluidState.massFraction(nPhaseIdx, H2OIdx);
+                fluidState.massFraction(phase1Idx, H2OIdx);
 
             result +=
                 Air::gasEnthalpy(T, p) *
-                fluidState.massFraction(nPhaseIdx, AirIdx);
+                fluidState.massFraction(phase1Idx, AirIdx);
             return result;
         }
         DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
@@ -697,11 +684,11 @@ public:
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
 
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             DUNE_THROW(Dune::NotImplemented, "The component enthalpies in the liquid phase are not implemented.");
         }
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
             if (componentIdx == H2OIdx)
             {
@@ -734,11 +721,11 @@ public:
 
         const Scalar temperature  = fluidState.temperature(phaseIdx) ;
         const Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             return H2O::liquidThermalConductivity(temperature, pressure);
         }
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
             return Air::gasThermalConductivity(temperature, pressure);
         }
@@ -763,15 +750,15 @@ public:
     {
         const Scalar temperature  = fluidState.temperature(phaseIdx);
         const Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             // influence of air is neglected
             return H2O::liquidHeatCapacity(temperature, pressure);
         }
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == phase1Idx)
         {
-            return Air::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(nPhaseIdx, AirIdx)
-                   + H2O::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(nPhaseIdx, H2OIdx);
+            return Air::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(phase1Idx, AirIdx)
+                   + H2O::gasHeatCapacity(temperature, pressure) * fluidState.moleFraction(phase1Idx, H2OIdx);
         }
         else
             DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh
index 250a4d63b93fb143cfd4ce8d14dfc22648fa1e9d..c84572b622fa49d23a5ea74bc64ba753740a100c 100644
--- a/dumux/material/fluidsystems/h2on2.hh
+++ b/dumux/material/fluidsystems/h2on2.hh
@@ -38,10 +38,8 @@
 
 #include "base.hh"
 
-namespace Dumux
-{
-namespace FluidSystems
-{
+namespace Dumux {
+namespace FluidSystems {
 
 /*!
  * \ingroup Fluidsystems
@@ -62,22 +60,27 @@ class H2ON2
     using SimpleN2 = Dumux::Components::N2<Scalar>;
 
 public:
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
+    using H2O = TabulatedH2O; //!< The components for pure water
+    using N2 = SimpleN2; //!< The components for pure nitrogen
 
-    //! Number of phases in the fluid system
-    static constexpr int numPhases = 2;
+    static constexpr int numPhases = 2; //!< Number of phases in the fluid system
+    static constexpr int numComponents = 2; //!< Number of components in the fluid system
 
-    static constexpr int wPhaseIdx = 0; // index of the wetting phase
-    static constexpr int nPhaseIdx = 1; // index of the non-wetting phase
+    static constexpr int liquidPhaseIdx = 0; //!< index of the liquid phase
+    static constexpr int gasPhaseIdx = 1; //!< index of the gas phase
+    static constexpr int phase0Idx = liquidPhaseIdx; //!< index of the first phase
+    static constexpr int phase1Idx = gasPhaseIdx; //!< index of the second phase
 
-    // export component indices to indicate the main component
-    // of the corresponding phase at atmospheric pressure 1 bar
-    // and room temperature 20°C:
-    static const int wCompIdx = wPhaseIdx;
-    static const int nCompIdx = nPhaseIdx;
+    static constexpr int H2OIdx = 0;
+    static constexpr int N2Idx = 1;
+    static constexpr int comp0Idx = H2OIdx; //!< index of the first component
+    static constexpr int comp1Idx = N2Idx; //!< index of the second component
+    static constexpr int liquidCompIdx = H2OIdx; //!< index of the liquid component
+    static constexpr int gasCompIdx = N2Idx; //!< index of the gas component
 
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
     /*!
      * \brief Return the human readable name of a fluid phase
      *
@@ -101,10 +104,10 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isLiquid(int phaseIdx)
+    static constexpr bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return phaseIdx != nPhaseIdx;
+        return phaseIdx != gasPhaseIdx;
     }
 
     /*!
@@ -143,7 +146,7 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // gases are always compressible
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == gasPhaseIdx)
             return true;
         // the water component decides for the liquid phase...
         return H2O::liquidIsCompressible();
@@ -159,7 +162,7 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == gasPhaseIdx)
             // let the components decide
             return H2O::gasIsIdeal() && N2::gasIsIdeal();
         return false; // not a gas
@@ -168,19 +171,6 @@ public:
     /****************************************
      * Component related static parameters
      ****************************************/
-
-    //! Number of components in the fluid system
-    static constexpr int numComponents = 2;
-
-    static constexpr int H2OIdx = wCompIdx;
-    static constexpr int N2Idx = nCompIdx;
-
-    //! The components for pure water
-    using H2O = TabulatedH2O;
-
-    //! The components for pure nitrogen
-    using N2 = SimpleN2;
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -259,12 +249,12 @@ public:
                                       const int phaseIdx,
                                       const int compIdx)
     {
-        assert(compIdx == wCompIdx && phaseIdx == wPhaseIdx);
+        assert(compIdx == wCompIdx && phaseIdx == liquidPhaseIdx);
 
         using std::exp;
         return fugacityCoefficient(fluidState, phaseIdx, compIdx)
                * fluidState.pressure(phaseIdx)
-               * exp(-(fluidState.pressure(nPhaseIdx)-fluidState.pressure(wPhaseIdx))
+               * exp(-(fluidState.pressure(gasPhaseIdx)-fluidState.pressure(liquidPhaseIdx))
                           / density(fluidState, phaseIdx)
                           / (Dumux::Constants<Scalar>::R / molarMass(compIdx))
                           / fluidState.temperature());
@@ -373,7 +363,7 @@ public:
             sumMoleFrac += fluidState.moleFraction(phaseIdx, compIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             if (!useComplexRelations)
                 // assume pure water
                 return H2O::liquidDensity(T, p);
@@ -387,9 +377,9 @@ public:
                 // water molecule in the liquid
                 return
                     clH2O
-                    * (H2O::molarMass()*fluidState.moleFraction(wPhaseIdx, H2OIdx)
+                    * (H2O::molarMass()*fluidState.moleFraction(liquidPhaseIdx, H2OIdx)
                        +
-                       N2::molarMass()*fluidState.moleFraction(wPhaseIdx, N2Idx))
+                       N2::molarMass()*fluidState.moleFraction(liquidPhaseIdx, N2Idx))
                     / sumMoleFrac;
             }
         }
@@ -400,12 +390,12 @@ public:
             // for the gas phase assume an ideal gas
             return
                 IdealGas::molarDensity(T, p)
-                * fluidState.averageMolarMass(nPhaseIdx)
+                * fluidState.averageMolarMass(gasPhaseIdx)
                 / max(1e-5, sumMoleFrac);
 
         // assume ideal mixture: steam and nitrogen don't "see" each other
-        Scalar rho_gH2O = H2O::gasDensity(T, p*fluidState.moleFraction(nPhaseIdx, H2OIdx));
-        Scalar rho_gN2 = N2::gasDensity(T, p*fluidState.moleFraction(nPhaseIdx, N2Idx));
+        Scalar rho_gH2O = H2O::gasDensity(T, p*fluidState.moleFraction(gasPhaseIdx, H2OIdx));
+        Scalar rho_gN2 = N2::gasDensity(T, p*fluidState.moleFraction(gasPhaseIdx, N2Idx));
         return (rho_gH2O + rho_gN2) / max(1e-5, sumMoleFrac);
     }
 
@@ -432,7 +422,7 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             // assume pure water for the liquid phase
             return H2O::liquidViscosity(T, p);
         }
@@ -514,7 +504,7 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             if (compIdx == H2OIdx)
                 return H2O::vaporPressure(T)/p;
             return BinaryCoeff::H2O_N2::henry(T)/p;
@@ -600,7 +590,7 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             if (compIIdx == H2OIdx && compJIdx == N2Idx)
                 return BinaryCoeff::H2O_N2::liquidDiffCoeff(T, p);
             return undefined;
@@ -635,7 +625,7 @@ public:
         Valgrind::CheckDefined(p);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             return H2O::liquidEnthalpy(T, p);
         }
         // gas phase
@@ -644,10 +634,10 @@ public:
             // that the total specific enthalpy is the sum of the
             // "partial specific enthalpies" of the components.
             Scalar hH2O =
-                fluidState.massFraction(nPhaseIdx, H2OIdx)
+                fluidState.massFraction(gasPhaseIdx, H2OIdx)
                 * H2O::gasEnthalpy(T, p);
             Scalar hN2 =
-                fluidState.massFraction(nPhaseIdx, N2Idx)
+                fluidState.massFraction(gasPhaseIdx, N2Idx)
                 * N2::gasEnthalpy(T, p);
             return hH2O + hN2;
         }
@@ -670,7 +660,7 @@ public:
 
         const Scalar temperature  = fluidState.temperature(phaseIdx) ;
         const Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == liquidPhaseIdx)
         {
             return H2O::liquidThermalConductivity(temperature, pressure);
         }
@@ -703,7 +693,7 @@ public:
     static Scalar heatCapacity(const FluidState &fluidState,
                                int phaseIdx)
     {
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             return H2O::liquidHeatCapacity(fluidState.temperature(phaseIdx),
                                            fluidState.pressure(phaseIdx));
         }
@@ -736,8 +726,8 @@ public:
 
         // mangle both components together
         return
-            c_pH2O*fluidState.massFraction(nPhaseIdx, H2OIdx)
-            + c_pN2*fluidState.massFraction(nPhaseIdx, N2Idx);
+            c_pH2O*fluidState.massFraction(gasPhaseIdx, H2OIdx)
+            + c_pN2*fluidState.massFraction(gasPhaseIdx, N2Idx);
     }
 };
 
diff --git a/dumux/material/fluidsystems/h2on2kinetic.hh b/dumux/material/fluidsystems/h2on2kinetic.hh
index a84dd2100a5679db0b5ed0c2baa0d3582258ffd1..12bff8ba1bf1ad9e7d2449a9fcbaacde4188cf4a 100644
--- a/dumux/material/fluidsystems/h2on2kinetic.hh
+++ b/dumux/material/fluidsystems/h2on2kinetic.hh
@@ -44,7 +44,7 @@ namespace FluidSystems
 /*!
  * \ingroup Fluidsystems
  * \brief A two-phase fluid system with two components water \f$(\mathrm{H_2O})\f$
- *        Nitrogen \f$(\mathrm{N_2})\f$ for non-equilibrium models.
+ *        Nitrogen \f$(\mathrm{N_2})\f$ for non-equilibrium models. TODO: Is this fluid system necessary??
  */
 template <class Scalar, bool useComplexRelations = true>
 class H2ON2Kinetic :
@@ -85,7 +85,7 @@ public:
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
         switch (phaseIdx){
-            case ParentType::wPhaseIdx:
+            case ParentType::liquidPhaseIdx:
                 switch(compIdx){
                 case ParentType::H2OIdx:
                     return ParentType::H2O::liquidEnthalpy(T, p);
@@ -97,7 +97,7 @@ public:
                     break;
                 }// end switch compIdx
                 break;
-            case ParentType::nPhaseIdx:
+            case ParentType::gasPhaseIdx:
                 switch(compIdx){
                 case ParentType::H2OIdx:
                     return ParentType::H2O::gasEnthalpy(T, p);
@@ -137,10 +137,10 @@ public:
                                                     const unsigned int referencePhaseIdx,
                                                     const unsigned int calcCompIdx)
     {
-        const unsigned int nPhaseIdx   = ParentType::nPhaseIdx;
-        const unsigned int wPhaseIdx   = ParentType::wPhaseIdx;
-        const unsigned int nCompIdx    = ParentType::nCompIdx;
-        const unsigned int wCompIdx    = ParentType::wCompIdx;
+        const unsigned int nPhaseIdx   = ParentType::gasPhaseIdx;
+        const unsigned int wPhaseIdx   = ParentType::liquidPhaseIdx;
+        const unsigned int nCompIdx    = ParentType::N2Idx;
+        const unsigned int wCompIdx    = ParentType::H2OIdx;
 
         assert(0 <= referencePhaseIdx && referencePhaseIdx < ParentType::numPhases);
         assert(0 <= calcCompIdx && calcCompIdx < ParentType::numComponents);
@@ -265,10 +265,10 @@ public:
     static void calculateEquilibriumMoleFractions(FluidState & fluidState,
                                                   const ParameterCache & paramCache)
     {
-        const unsigned int nPhaseIdx    = ParentType::nPhaseIdx;
-        const unsigned int wPhaseIdx    = ParentType::wPhaseIdx;
-        const unsigned int nCompIdx     = ParentType::nCompIdx;
-        const unsigned int wCompIdx     = ParentType::wCompIdx;
+        const unsigned int nPhaseIdx    = ParentType::gasPhaseIdx;
+        const unsigned int wPhaseIdx    = ParentType::liquidPhaseIdx;
+        const unsigned int nCompIdx     = ParentType::N2Idx;
+        const unsigned int wCompIdx     = ParentType::H2OIdx;
         const unsigned int numPhases    = ParentType::numPhases;
         const unsigned int numComponents= ParentType::numComponents;
 
diff --git a/dumux/material/fluidsystems/h2on2o2.hh b/dumux/material/fluidsystems/h2on2o2.hh
index 123e0fa81cbb1440cce3ed3ebbb3944c5edc4812..24c5ca61643e5ba5ae9c8be5a372f6492e78695f 100644
--- a/dumux/material/fluidsystems/h2on2o2.hh
+++ b/dumux/material/fluidsystems/h2on2o2.hh
@@ -43,10 +43,8 @@
 #include <dumux/material/binarycoefficients/h2o_o2.hh>
 #include <dumux/material/binarycoefficients/n2_o2.hh>
 
-namespace Dumux
-{
-namespace FluidSystems
-{
+namespace Dumux {
+namespace FluidSystems {
 
 /*!
  * \ingroup Fluidsystems
@@ -78,18 +76,30 @@ class H2ON2O2
     using N2 = SimpleN2;
 
 public:
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
+    static constexpr int numPhases = 2; //!< Number of phases in the fluid system
+    static constexpr int numComponents = 3; //!< Number of components in the fluid system
+    static constexpr int numSPhases = 0; // TODO: Remove
+
+    static constexpr int liquidPhaseIdx = 0; //!< index of the liquid phase
+    static constexpr int gasPhaseIdx = 1; //!< index of the gas phase
+    static constexpr int phase0Idx = liquidPhaseIdx; //!< index of the first phase
+    static constexpr int phase1Idx = gasPhaseIdx; //!< index of the second phase
+
+    static constexpr int H2OIdx = 0;
+    static constexpr int N2Idx = 1;
+    static constexpr int O2Idx = 2;
 
-    //! Number of phases in the fluid system
-    static constexpr int numPhases = 2;
-    //! Number of solid phases besides the solid matrix
-    static constexpr int numSPhases = 0;
+    static constexpr int comp0Idx = H2OIdx; // first major component
+    static constexpr int comp1Idx = N2Idx; // second major component
+    static constexpr int comp2Idx = O2Idx; // secondary component
 
-    static constexpr int wPhaseIdx = 0; // index of the wetting phase
-    static constexpr int nPhaseIdx = 1; // index of the non-wetting phase
+    // main component at 20°C and 1 bar
+    static constexpr int liquidPhaseMainCompIdx = H2OIdx;
+    static constexpr int gasPhaseMainCompIdx = N2Idx;
 
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
     /*!
      * \brief Return the human readable name of a fluid phase
      *
@@ -114,7 +124,7 @@ public:
     static bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return phaseIdx != nPhaseIdx;
+        return phaseIdx != gasPhaseIdx;
     }
 
     /*!
@@ -153,7 +163,7 @@ public:
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // gases are always compressible
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == gasPhaseIdx)
             return true;
         // the water component decides for the liquid phase...
         return H2O::liquidIsCompressible();
@@ -168,7 +178,7 @@ public:
     static bool isIdealGas(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == nPhaseIdx)
+        if (phaseIdx == gasPhaseIdx)
             // let the components decide
             return H2O::gasIsIdeal() && N2::gasIsIdeal() && O2::gasIsIdeal();
         return false; // not a gas
@@ -177,23 +187,6 @@ public:
     /****************************************
      * Component related static parameters
      ****************************************/
-
-    //! Number of components in the fluid system
-    static constexpr int numComponents = 3;
-    // There are no secondary components (still 2pNc model needs this parameter)
-    static const int numSecComponents = 1;
-    static const int numMajorComponents = 2;
-
-    static constexpr int H2OIdx = 0;//first major component
-    static constexpr int N2Idx = 1;//second major component
-    static constexpr int O2Idx = 2;//secondary component
-
-    // export component indices to indicate the main component
-    // of the corresponding phase at atmospheric pressure 1 bar
-    // and room temperature 20C:
-    static const int wCompIdx = wPhaseIdx; //=0 -> H2OIdx
-    static const int nCompIdx = nPhaseIdx; //=1 -> N2Idx
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -307,8 +300,8 @@ public:
                                       const int compIdx,
                                       const Scalar radius)
     {
-        assert(0 <= phaseIdx  && phaseIdx == wPhaseIdx);
-        assert(0 <= compIdx  && compIdx == wCompIdx);
+        assert(0 <= phaseIdx  && phaseIdx == liquidPhaseIdx);
+        assert(0 <= compIdx  && compIdx == liquidPhaseMainCompIdx);
 
         Scalar T = fluidState.temperature(phaseIdx);
 
@@ -335,12 +328,12 @@ public:
                                       const int phaseIdx,
                                       const int compIdx)
     {
-        assert(compIdx == wCompIdx && phaseIdx == wPhaseIdx);
+        assert(compIdx == liquidPhaseMainCompIdx && phaseIdx == liquidPhaseIdx);
 
         using std::exp;
         return fugacityCoefficient(fluidState, phaseIdx, compIdx)
                * fluidState.pressure(phaseIdx)
-               * exp(-(fluidState.pressure(nPhaseIdx)-fluidState.pressure(wPhaseIdx))
+               * exp(-(fluidState.pressure(gasPhaseIdx)-fluidState.pressure(liquidPhaseIdx))
                           / density(fluidState, phaseIdx)
                           / (Dumux::Constants<Scalar>::R / molarMass(compIdx))
                           / fluidState.temperature());
@@ -442,7 +435,7 @@ public:
             sumMoleFrac += fluidState.moleFraction(phaseIdx, compIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             if (!useComplexRelations)
                 // assume pure water
                 return H2O::liquidDensity(T, p);
@@ -456,11 +449,11 @@ public:
                 // water molecule in the liquid
                 return
                     clH2O*
-                    (fluidState.moleFraction(wPhaseIdx, H2OIdx)*H2O::molarMass()
+                    (fluidState.moleFraction(liquidPhaseIdx, H2OIdx)*H2O::molarMass()
                     +
-                    fluidState.moleFraction(wPhaseIdx, N2Idx)*N2::molarMass()
+                    fluidState.moleFraction(liquidPhaseIdx, N2Idx)*N2::molarMass()
                     +
-                    fluidState.moleFraction(wPhaseIdx, O2Idx)*O2::molarMass())
+                    fluidState.moleFraction(liquidPhaseIdx, O2Idx)*O2::molarMass())
                     / sumMoleFrac;
             }
         }
@@ -471,14 +464,14 @@ public:
             // for the gas phase assume an ideal gas
             return
                 IdealGas::molarDensity(T, p)
-                * fluidState.averageMolarMass(nPhaseIdx)
+                * fluidState.averageMolarMass(gasPhaseIdx)
                 / max(1e-5, sumMoleFrac);
 
         // assume ideal mixture: steam, nitrogen and oxygen don't "see" each
         // other
-        Scalar rho_gH2O = H2O::gasDensity(T, p*fluidState.moleFraction(nPhaseIdx, H2OIdx));
-        Scalar rho_gN2 = N2::gasDensity(T, p*fluidState.moleFraction(nPhaseIdx, N2Idx));
-        Scalar rho_gO2 = O2::gasDensity(T, p*fluidState.moleFraction(nPhaseIdx, O2Idx));
+        Scalar rho_gH2O = H2O::gasDensity(T, p*fluidState.moleFraction(gasPhaseIdx, H2OIdx));
+        Scalar rho_gN2 = N2::gasDensity(T, p*fluidState.moleFraction(gasPhaseIdx, N2Idx));
+        Scalar rho_gO2 = O2::gasDensity(T, p*fluidState.moleFraction(gasPhaseIdx, O2Idx));
         return (rho_gH2O + rho_gN2 + rho_gO2 ) / max(1e-5, sumMoleFrac);
     }
 
@@ -505,7 +498,7 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             // assume pure water for the liquid phase
             return H2O::liquidViscosity(T, p);
         }
@@ -579,7 +572,7 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == liquidPhaseIdx)
         {
             switch(compIdx){
             case H2OIdx: return H2O::vaporPressure(T)/p;
@@ -665,7 +658,7 @@ public:
         Scalar p = fluidState.pressure(phaseIdx);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             if (compIIdx == H2OIdx && compJIdx == N2Idx)
                 return BinaryCoeff::H2O_N2::liquidDiffCoeff(T, p);
             if (compIIdx == H2OIdx && compJIdx == O2Idx)
@@ -676,7 +669,7 @@ public:
                        << " in phase " << phaseIdx << " is undefined!\n");
         }
         // gas phase
-        if (phaseIdx == nPhaseIdx) {
+        if (phaseIdx == gasPhaseIdx) {
             if (compIIdx == H2OIdx && compJIdx == N2Idx)
                 return BinaryCoeff::H2O_N2::gasDiffCoeff(T, p);
             if (compIIdx == H2OIdx && compJIdx == O2Idx)
@@ -718,23 +711,23 @@ public:
         Valgrind::CheckDefined(p);
 
         // liquid phase
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             return H2O::liquidEnthalpy(T, p);
         }
         // gas phase
-        else if (phaseIdx == nPhaseIdx)
+        else if (phaseIdx == gasPhaseIdx)
         {
             // assume ideal mixture: which means
             // that the total specific enthalpy is the sum of the
             // "partial specific enthalpies" of the components.
             Scalar hH2O =
-                fluidState.massFraction(nPhaseIdx, H2OIdx)
+                fluidState.massFraction(gasPhaseIdx, H2OIdx)
                 * H2O::gasEnthalpy(T, p);
             Scalar hN2 =
-                fluidState.massFraction(nPhaseIdx, N2Idx)
+                fluidState.massFraction(gasPhaseIdx, N2Idx)
                 * N2::gasEnthalpy(T,p);
             Scalar hO2 =
-                fluidState.massFraction(nPhaseIdx, O2Idx)
+                fluidState.massFraction(gasPhaseIdx, O2Idx)
                 * O2::gasEnthalpy(T,p);
             return hH2O + hN2 + hO2;
         }
@@ -770,7 +763,7 @@ public:
         Scalar temperature  = fluidState.temperature(phaseIdx) ;
         Scalar pressure = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == liquidPhaseIdx)
         {
             return H2O::liquidThermalConductivity(temperature, pressure);
         }
@@ -806,7 +799,7 @@ public:
     static Scalar heatCapacity(const FluidState &fluidState,
                                int phaseIdx)
     {
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == liquidPhaseIdx) {
             return H2O::liquidHeatCapacity(fluidState.temperature(phaseIdx),
                                            fluidState.pressure(phaseIdx));
         }
@@ -847,9 +840,9 @@ public:
 
         // mangle all components together
         return
-            c_pH2O*fluidState.massFraction(nPhaseIdx, H2OIdx)
-            + c_pN2*fluidState.massFraction(nPhaseIdx, N2Idx)
-            + c_pO2*fluidState.massFraction(nPhaseIdx, O2Idx);
+            c_pH2O*fluidState.massFraction(gasPhaseIdx, H2OIdx)
+            + c_pN2*fluidState.massFraction(gasPhaseIdx, N2Idx)
+            + c_pO2*fluidState.massFraction(gasPhaseIdx, O2Idx);
     }
 
 };
diff --git a/dumux/material/fluidsystems/liquidphase2c.hh b/dumux/material/fluidsystems/liquidphase2c.hh
index 259dc2c2f48082452501036359add78d877da33b..4cfd409d0c9ccae811aaf8d7461ca0e09a67f9b5 100644
--- a/dumux/material/fluidsystems/liquidphase2c.hh
+++ b/dumux/material/fluidsystems/liquidphase2c.hh
@@ -31,10 +31,8 @@
 #include <dumux/material/fluidsystems/base.hh>
 #include <dumux/material/binarycoefficients/h2o_constant.hh>
 
-namespace Dumux
-{
-namespace FluidSystems
-{
+namespace Dumux {
+namespace FluidSystems {
 
 /*!
  * \ingroup Fluidsystems
@@ -52,21 +50,25 @@ class LiquidPhaseTwoC
 public:
     using ParameterCache = NullParameterCache;
 
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
-    static constexpr int mainCompIdx = 0;
-    static constexpr int secondCompIdx = 1;
-    static constexpr int wPhaseIdx = 0;
-    static constexpr int numPhases = 1;
-    static constexpr int numComponents = 2;
+    static constexpr int numPhases = 2; //!< Number of phases in the fluid system
+    static constexpr int numComponents = 2; //!< Number of components in the fluid system
+
+    static constexpr int phase0Idx = 0; //!< index of the only phase
+
+    static constexpr int comp0Idx = 0; //!< index of the frist component
+    static constexpr int comp1Idx = 1; //!< index of the second component
+    static constexpr int mainCompIdx = comp0Idx; //!< index of the main component
+    static constexpr int secondCompIdx = comp1Idx; //!< index of the secondary component
 
     /*!
-     * \brief Initialize the fluid system's static parameters generically
-     */
+    * \brief Initialize the fluid system's static parameters generically
+    */
     static void init()
     {}
 
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
     /*!
      * \brief Return the human readable name of a fluid phase
      *
@@ -191,8 +193,8 @@ public:
         const Scalar densityMain = MainComponent::liquidDensity(T, p);
         const Scalar molarDensity = densityMain/MainComponent::molarMass();
 
-        return molarDensity * (MainComponent::molarMass()*fluidState.moleFraction(wPhaseIdx, mainCompIdx)
-                               + SecondComponent::molarMass()*fluidState.moleFraction(wPhaseIdx, secondCompIdx));
+        return molarDensity * (MainComponent::molarMass()*fluidState.moleFraction(phase0Idx, mainCompIdx)
+                               + SecondComponent::molarMass()*fluidState.moleFraction(phase0Idx, secondCompIdx));
     }
 
     /*!
diff --git a/dumux/material/fluidsystems/nullparametercache.hh b/dumux/material/fluidsystems/nullparametercache.hh
index a056632b89c0b8420dd9ee85461bf0cb9bfe754a..d140b381c5e9f226a38f4114fd7199eca222e99d 100644
--- a/dumux/material/fluidsystems/nullparametercache.hh
+++ b/dumux/material/fluidsystems/nullparametercache.hh
@@ -26,18 +26,12 @@
 
 #include "parametercachebase.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 /*!
  * \ingroup Fluidsystems
  * \brief The a parameter cache which does nothing
  */
-class NullParameterCache : public ParameterCacheBase<NullParameterCache>
-{
-public:
-    NullParameterCache()
-    {};
-};
+class NullParameterCache : public ParameterCacheBase<NullParameterCache> {};
 
 } // end namespace
 
diff --git a/dumux/material/fluidsystems/steamn2cao2h2.hh b/dumux/material/fluidsystems/steamn2cao2h2.hh
index 13f339e64231e4a1822f580ce03bd765824fb5ad..ee8f743160df9ac38b96914bd2339aa16949395b 100644
--- a/dumux/material/fluidsystems/steamn2cao2h2.hh
+++ b/dumux/material/fluidsystems/steamn2cao2h2.hh
@@ -39,10 +39,9 @@
 #include <dumux/material/binarycoefficients/h2o_n2.hh>
 #include <dumux/material/components/tabulatedcomponent.hh>
 
-namespace Dumux
-{
-namespace FluidSystems
-{
+namespace Dumux {
+namespace FluidSystems {
+
 /*!
  * \ingroup Fluidsystems
  *
@@ -77,21 +76,29 @@ public:
     // the type of parameter cache objects. this fluid system does not
     using ParameterCache = Dumux::NullParameterCache;
 
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
-
     //! Number of phases in the fluid system
     static constexpr int numPhases = 1; //gas phase: N2 and steam
-    static const int numSPhases = 2;//  solid phases CaO and CaO2H2
+    static constexpr int numComponents = 2; // H2O, Air
+    static constexpr int numSPhases = 2;//  solid phases CaO and CaO2H2 TODO: Remove
+    static constexpr int numSComponents = 2;// CaO2H2, CaO TODO: Remove
+
+    static constexpr int gasPhaseIdx = 0;  //!< index of the gas phase
+    static constexpr int phase0Idx = gasPhaseIdx; //!< index of the only phase
 
-    static constexpr int gPhaseIdx = 0;
-    static const int nPhaseIdx = gPhaseIdx; // index of the gas phase
+    static constexpr int cPhaseIdx = 1; // CaO-phaseIdx TODO: Remove
+    static constexpr int hPhaseIdx = 2; // CaO2H2-phaseIdx TODO: Remove
 
-    static constexpr int cPhaseIdx = 1; // CaO-phaseIdx
-    static constexpr int hPhaseIdx = 2; // CaO2H2-phaseIdx
+    static constexpr int N2Idx = 0;
+    static constexpr int H2OIdx = 1;
+    static constexpr int comp0Idx = N2Idx;
+    static constexpr int comp1Idx = H2OIdx;
 
+    static constexpr int CaOIdx  = 2; // CaO-phaseIdx TODO: Remove
+    static constexpr int CaO2H2Idx  = 3; // CaO-phaseIdx TODO: Remove
 
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
     /*!
      * \brief Return the human readable name of a fluid phase
      *
@@ -100,7 +107,7 @@ public:
     static std::string phaseName(int phaseIdx)
     {
         switch (phaseIdx) {
-        case nPhaseIdx: return "gas";
+        case gasPhaseIdx: return "gas";
         case cPhaseIdx : return "CaO";
         case hPhaseIdx : return "CaOH2";
         }
@@ -118,10 +125,10 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isGas (int phaseIdx)
+    static constexpr bool isGas (int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return phaseIdx == nPhaseIdx;
+        return phaseIdx == gasPhaseIdx;
     }
 
     /*!
@@ -138,7 +145,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealMixture(int phaseIdx)
+    static constexpr bool isIdealMixture(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         // we assume no interaction between gas molecules of different
@@ -155,7 +162,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isCompressible(int phaseIdx)
+    static constexpr bool isCompressible(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
@@ -168,7 +175,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealGas(int phaseIdx)
+    static constexpr bool isIdealGas(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
 
@@ -179,18 +186,6 @@ public:
     /****************************************
     * Component related static parameters
     ****************************************/
-
-    static const int numComponents = 2; // H2O, Air
-    static const int numMajorComponents = 2;// H2O, Air
-    static const int numSComponents = 2;// CaO2H2, CaO
-
-
-    static const int N2Idx = 0;
-    static const int H2OIdx = 1;
-    static const int CaOIdx  = 2;
-    static const int CaO2H2Idx  = 3;
-
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -355,13 +350,13 @@ public:
             // for the gas phase assume an ideal gas
             return
                 IdealGas::molarDensity(T, p)
-                * fluidState.averageMolarMass(nPhaseIdx)
+                * fluidState.averageMolarMass(gasPhaseIdx)
                 / std::max(1e-5, sumMoleFrac);
         else
         {
             return
-                (H2O::gasDensity(T, fluidState.partialPressure(nPhaseIdx, H2OIdx)) +
-                N2::gasDensity(T, fluidState.partialPressure(nPhaseIdx, N2Idx)));
+                (H2O::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx)) +
+                N2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx)));
         }
       }
 
@@ -440,7 +435,7 @@ public:
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
 
-        assert(phaseIdx == gPhaseIdx);
+        assert(phaseIdx == gasPhaseIdx);
 
         if (compIIdx != N2Idx)
             std::swap(compIIdx, compJIdx);
@@ -476,13 +471,13 @@ public:
     static Scalar enthalpy(const FluidState &fluidState,
                            int phaseIdx)
     {
-        assert(phaseIdx == gPhaseIdx);
+        assert(phaseIdx == gasPhaseIdx);
 
         Scalar T = fluidState.temperature(phaseIdx);
         Scalar p = fluidState.pressure(phaseIdx);
 
-        Scalar XN2 = fluidState.massFraction(gPhaseIdx, N2Idx);
-        Scalar XH2O = fluidState.massFraction(gPhaseIdx, H2OIdx);
+        Scalar XN2 = fluidState.massFraction(gasPhaseIdx, N2Idx);
+        Scalar XH2O = fluidState.massFraction(gasPhaseIdx, H2OIdx);
 
         Scalar result = 0;
         result += XH2O * H2O::gasEnthalpy(T, p);
@@ -503,8 +498,8 @@ public:
                                     int phaseIdx,
                                     int componentIdx)
     {
-        Scalar T = fluidState.temperature(nPhaseIdx);
-        Scalar p = fluidState.pressure(nPhaseIdx);
+        Scalar T = fluidState.temperature(gasPhaseIdx);
+        Scalar p = fluidState.pressure(gasPhaseIdx);
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
 
@@ -525,7 +520,7 @@ public:
                                     int componentIdx)
     {
         Scalar T = 573.15;
-        Scalar p = fluidState.pressure(nPhaseIdx);
+        Scalar p = fluidState.pressure(gasPhaseIdx);
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
 
@@ -609,7 +604,7 @@ public:
                                     fluidState.pressure(phaseIdx)
                                     * fluidState.moleFraction(phaseIdx, H2OIdx));
 
-        return c_pH2O*fluidState.moleFraction(nPhaseIdx, H2OIdx) + c_pN2*fluidState.moleFraction(nPhaseIdx, N2Idx);
+        return c_pH2O*fluidState.moleFraction(gasPhaseIdx, H2OIdx) + c_pN2*fluidState.moleFraction(gasPhaseIdx, N2Idx);
     }
 
 };
diff --git a/dumux/material/spatialparams/fv.hh b/dumux/material/spatialparams/fv.hh
index f97b121c5dd557843b54532368e1ed50b19403d2..2263814954b7e01163789e45ae6702847c691631 100644
--- a/dumux/material/spatialparams/fv.hh
+++ b/dumux/material/spatialparams/fv.hh
@@ -50,9 +50,11 @@ class FVSpatialParams: public FVSpatialParamsOneP<TypeTag>
     using GlobalPosition = Dune::FieldVector<typename GridView::ctype, dimWorld>;
 
 public:
-    FVSpatialParams(const Problem& problem)
-    : FVSpatialParamsOneP<TypeTag>(problem)
-    {}
+    //! export the type used for the material law
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+
+    //! The constructor
+    FVSpatialParams(const Problem& problem) : FVSpatialParamsOneP<TypeTag>(problem) {}
 
     /*!
      * \brief Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw, etc.).
@@ -82,6 +84,36 @@ public:
                    "The spatial parameters do not provide "
                    "a materialLawParamsAtPos() method.");
     }
+
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \param element The current element
+     * \param scv The sub-control volume inside the element.
+     * \param elemSol The solution at the dofs connected to the element.
+     * \return the wetting phase index
+     */
+    template<class FluidSystem, class ElementSolution>
+    int wettingPhase(const Element& element,
+                     const SubControlVolume& scv,
+                     const ElementSolution& elemSol) const
+    {
+        return this->asImp_().template wettingPhaseAtPos<FluidSystem>(scv.center());
+    }
+
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The global position
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    {
+        DUNE_THROW(Dune::InvalidStateException,
+                   "The spatial parameters do not provide "
+                   "a wettingPhaseAtPos() method.");
+    }
 };
 
 } // namespace Dumux
diff --git a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh
index c30045de5899c5bfafb9fdfb4cc1b0d5f29e957f..72237fdb8ab11f0b86faafb829343d24b5488446 100644
--- a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh
+++ b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh
@@ -52,7 +52,7 @@ class OnePIncompressibleLocalResidual : public ImmiscibleLocalResidual<TypeTag>
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     // first index for the mass balance
     enum { conti0EqIdx = Indices::conti0EqIdx };
     enum { pressureIdx = Indices::pressureIdx };
diff --git a/dumux/porousmediumflow/1p/indices.hh b/dumux/porousmediumflow/1p/indices.hh
index e429d4748a9a98356e1bb3e8c6def0a00a7895e3..28dbe586778088947919cf12de404dce5fa25e49 100644
--- a/dumux/porousmediumflow/1p/indices.hh
+++ b/dumux/porousmediumflow/1p/indices.hh
@@ -24,18 +24,21 @@
 #ifndef DUMUX_1P_INDICES_HH
 #define DUMUX_1P_INDICES_HH
 
-namespace Dumux
-{
+namespace Dumux {
 // \{
 
 /*!
  * \ingroup OnePModel
  * \brief Indices for the one-phase model.
+ *
+ * \tparam offset The first index in a primary variable vector.
  */
+template<int offset = 0>
 struct OnePIndices
 {
-    static const int conti0EqIdx = 0; //!< index for the mass balance
-    static const int pressureIdx = 0; //!< index of the primary variable
+    static const int PVOffset = offset;      //!< the first index in primary variable vector
+    static const int conti0EqIdx = PVOffset; //!< index for the mass balance
+    static const int pressureIdx = PVOffset; //!< index of the primary variable
 };
 
 // \}
diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh
index 8ec275b6f4a8a3856905c4be63c4fd93c6a522b7..e025fdbdd202a9d29f54042f34bd45994d426910 100644
--- a/dumux/porousmediumflow/1p/model.hh
+++ b/dumux/porousmediumflow/1p/model.hh
@@ -50,7 +50,6 @@
 #include <dumux/porousmediumflow/properties.hh>
 #include <dumux/porousmediumflow/immiscible/localresidual.hh>
 #include <dumux/porousmediumflow/nonisothermal/model.hh>
-#include <dumux/porousmediumflow/nonisothermal/indices.hh>
 #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh>
 
 #include "indices.hh"
@@ -58,13 +57,15 @@
 #include "vtkoutputfields.hh"
 
 namespace Dumux {
+
 /*!
  * \ingroup OnePModel
  * \brief Specifies a number properties of single-phase models.
  */
 struct OnePModelTraits
 {
-    using Indices = OnePIndices;
+    //! Per default, we use the indices without offset
+    using Indices = OnePIndices<>;
 
     static constexpr int numEq() { return 1; }
     static constexpr int numPhases() { return 1; }
@@ -75,6 +76,30 @@ struct OnePModelTraits
     static constexpr bool enableEnergyBalance() { return false; }
 };
 
+/*!
+ * \ingroup OnePModel
+ * \brief Traits class for the volume variables of the single-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV,
+         class FSY,
+         class FST,
+         class PT,
+         class MT>
+struct OnePVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+};
+
 namespace Properties {
 //! The type tags for the isothermal single phase model
 NEW_TYPE_TAG(OneP, INHERITS_FROM(PorousMediumFlow));
@@ -86,9 +111,22 @@ NEW_TYPE_TAG(OnePNI, INHERITS_FROM(OneP));
 ///////////////////////////////////////////////////////////////////////////
 SET_TYPE_PROP(OneP, VtkOutputFields, OnePVtkOutputFields);            //!< default vtk output fields specific to this model
 SET_TYPE_PROP(OneP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< the local residual function
-SET_TYPE_PROP(OneP, VolumeVariables, OnePVolumeVariables<TypeTag>);   //!< the VolumeVariables property
 SET_TYPE_PROP(OneP, ModelTraits, OnePModelTraits);                    //!< states some specifics of the one-phase model
-SET_TYPE_PROP(OneP, Indices, OnePIndices);                            //!< Indices used by the one-phase model
+
+//! Set the volume variables property
+SET_PROP(OneP, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = OnePVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = OnePVolumeVariables<Traits>;
+};
 
 /*!
  * \brief The fluid state which is used by the volume variables to
@@ -108,18 +146,17 @@ public:
 ///////////////////////////////////////////////////////////////////////////
 // properties for the non-isothermal single phase model
 ///////////////////////////////////////////////////////////////////////////
-SET_TYPE_PROP(OnePNI, VtkOutputFields, EnergyVtkOutputFields<OnePVtkOutputFields>); //!< Add temperature to the output
-SET_TYPE_PROP(OnePNI, ModelTraits, PorousMediumFlowNIModelTraits<OnePModelTraits>); //!< The model traits of the non-isothermal model
-SET_PROP(OnePNI, Indices)                                                           //!< Indices of the non-isothermal model
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<OnePIndices, numEq, 0>;
-};
+
+//! Add temperature to the output
+SET_TYPE_PROP(OnePNI, VtkOutputFields, EnergyVtkOutputFields<OnePVtkOutputFields>);
+
+//! The model traits of the non-isothermal model
+SET_TYPE_PROP(OnePNI, ModelTraits, PorousMediumFlowNIModelTraits<OnePModelTraits>);
+
+//! Use the average for effective conductivities
 SET_TYPE_PROP(OnePNI,
               ThermalConductivityModel,
-              ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>); //!< Use the average for effective conductivities
+              ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
 } // end namespace Properties
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressure.hh b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressure.hh
index a2213e2d329dd6512f8ed273d4e6cdd68a49d4e3..4c74a1881e04b71a873f75d35b08b24eff3dcac6 100644
--- a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressure.hh
+++ b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressure.hh
@@ -60,7 +60,7 @@ template<class TypeTag> class FVPressure1P: public FVPressure<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
diff --git a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh
index e046a33ec47c1ebabe7cd0c974e33500ca089ca0..c1a4b8f51e991a7c58566716ca8bb9a8e69bce93 100644
--- a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh
+++ b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh
@@ -52,7 +52,7 @@ class FVVelocity1P
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
diff --git a/dumux/porousmediumflow/1p/volumevariables.hh b/dumux/porousmediumflow/1p/volumevariables.hh
index 4c333203ed2233737610aace22565175144f8faa..2b3b51573f61c0dd6731acc0cc2149fbf1566eb1 100644
--- a/dumux/porousmediumflow/1p/volumevariables.hh
+++ b/dumux/porousmediumflow/1p/volumevariables.hh
@@ -34,26 +34,24 @@ namespace Dumux {
  * \ingroup OnePModel
  * \brief Contains the quantities which are constant within a
  *        finite volume in the one-phase model.
+ *
+ * \tparam Traits Class encapsulating types to be used by the vol vars
  */
-template <class TypeTag>
-class OnePVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template<class Traits>
+class OnePVolumeVariables : public PorousMediumFlowVolumeVariables< Traits, OnePVolumeVariables<Traits> >
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
+    using ThisType = OnePVolumeVariables<Traits>;
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, ThisType>;
 
-public:
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using Indices = typename Traits::ModelTraits::Indices;
+    using PermeabilityType = typename Traits::PermeabilityType;
 
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+public:
+    //! export the underlying fluid system
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export the fluid state type
+    using FluidState = typename Traits::FluidState;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -64,11 +62,11 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
 
@@ -88,11 +86,11 @@ public:
      * \param scv The sub-control volume
      * \param fluidState A container with the current (physical) state of the fluid
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static void completeFluidState(const ElemSol &elemSol,
                                    const Problem& problem,
                                    const Element& element,
-                                   const SubControlVolume& scv,
+                                   const Scv& scv,
                                    FluidState& fluidState)
     {
         Scalar t = ParentType::temperature(elemSol, problem, element, scv);
@@ -193,12 +191,6 @@ protected:
     FluidState fluidState_;
     Scalar porosity_;
     PermeabilityType permeability_;
-
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
-
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
 };
 
 }
diff --git a/dumux/porousmediumflow/1pnc/indices.hh b/dumux/porousmediumflow/1pnc/indices.hh
index 925e9f52b6176baad7a8fa5b8ceaa97b923713c0..8cc311402979ae78dfc8430f27b8d395dd777ca5 100644
--- a/dumux/porousmediumflow/1pnc/indices.hh
+++ b/dumux/porousmediumflow/1pnc/indices.hh
@@ -26,36 +26,25 @@
 #ifndef DUMUX_1PNC_INDICES_HH
 #define DUMUX_1PNC_INDICES_HH
 
-#include <dumux/common/properties.hh>
+namespace Dumux {
 
-namespace Dumux
-{
 /*!
  * \ingroup OnePNCModel
  * \brief The indices for the isothermal one-phase n-component model.
  *
- * \tparam phaseIndex The default phase index
- * \tparam PVOffset The first index in a primary variable vector.
+ * \tparam phaseIdx The index of the fluid phase in the fluid system
  */
-template <int phaseIndex, int PVOffset = 0>
+template<int phaseIdx>
 struct OnePNCIndices
 {
-    //! Set the default phase used by the fluid system to the first one
-    static const int phaseIdx = phaseIndex;
-
-    //! Component indices
-    static const int phaseCompIdx = phaseIdx;//!< The index of the main component of the considered phase
-
-    //! Equation indices
-    static const int conti0EqIdx = PVOffset + 0; //!< Reference index for mass conservation equation.
-
-    //! Primary variable indices
-    static const int pressureIdx = PVOffset + 0; //!< Index for wetting/non-wetting phase pressure (depending on formulation) in a solution vector
-    static const int firstMoleFracIdx = PVOffset + 1; //!< Index of the either the saturation or the mass fraction of the fluid phase
-
-    //Component indices
-    static const int firstTransportEqIdx = PVOffset + 1; //!< transport equation index
+    //! Reference index for mass conservation equation.
+    static constexpr int conti0EqIdx = 0;
+    //! Index for wetting/non-wetting phase pressure (depending on formulation) in a solution vector
+    static constexpr int pressureIdx = phaseIdx;
+    //! The index of the fluid phase in the fluid system
+    static constexpr int fluidSystemPhaseIdx = phaseIdx;
 };
-}
+
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/1pnc/model.hh b/dumux/porousmediumflow/1pnc/model.hh
index c4449e8ea3756e7917413ceb659a9ece528adf9b..1710578a1853e8d770c11f1d0f09a5187eaa7785 100644
--- a/dumux/porousmediumflow/1pnc/model.hh
+++ b/dumux/porousmediumflow/1pnc/model.hh
@@ -74,18 +74,21 @@
 #include "volumevariables.hh"
 #include "vtkoutputfields.hh"
 
-namespace Dumux
-{
+namespace Dumux {
+
 /*!
  * \ingroup OnePNCModel
  * \brief Specifies a number properties of models that
  *        consider a single-phase with multiple components.
  *
- * \Å£param nComp the number of components to be considered.
+ * \tparam nComp the number of components to be considered.
+ * \tparam fluidSystemPhaseIdx The index of the fluid phase in the fluid system
  */
-template<int nComp>
+template<int nComp, int fluidSystemPhaseIdx>
 struct OnePNCModelTraits
 {
+    using Indices = OnePNCIndices<fluidSystemPhaseIdx>;
+
     static constexpr int numEq() { return nComp; }
     static constexpr int numPhases() { return 1; }
     static constexpr int numComponents() { return nComp; }
@@ -95,8 +98,28 @@ struct OnePNCModelTraits
     static constexpr bool enableEnergyBalance() { return false; }
 };
 
-namespace Properties
+/*!
+ * \ingroup OnePNCModel
+ * \brief Traits class for the volume variables of the single-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct OnePNCVolumeVariablesTraits
 {
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+};
+
+namespace Properties {
+
 //////////////////////////////////////////////////////////////////
 // Type tags
 //////////////////////////////////////////////////////////////////
@@ -115,17 +138,11 @@ SET_PROP(OnePNC, ModelTraits)
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem));
 public:
-    using type = OnePNCModelTraits<FluidSystem::numComponents>;
+    using type = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, PhaseIdx)>;
 };
 
 //! Set as default that no component mass balance is replaced by the total mass balance
-SET_PROP(OnePNC, ReplaceCompEqIdx)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem));
-public:
-    static constexpr auto value = FluidSystem::numComponents;
-};
+SET_INT_PROP(OnePNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents());
 
 /*!
  * \brief The fluid state which is used by the volume variables to
@@ -134,11 +151,12 @@ public:
  *        This can be done in the problem.
  */
 SET_PROP(OnePNC, FluidState){
-    private:
-        using Scalar =  typename GET_PROP_TYPE(TypeTag, Scalar);
-        using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    public:
-        using type = Dumux::CompositionalFluidState<Scalar, FluidSystem>;
+private:
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+public:
+    using type = CompositionalFluidState<Scalar, FluidSystem>;
 };
 
 //! Use the model after Millington (1961) for the effective diffusivity
@@ -147,55 +165,45 @@ SET_TYPE_PROP(OnePNC, EffectiveDiffusivityModel,
 
 SET_INT_PROP(OnePNC, PhaseIdx, 0); //!< The default phase index
 SET_TYPE_PROP(OnePNC, LocalResidual, CompositionalLocalResidual<TypeTag>);        //!< The local residual function
-SET_TYPE_PROP(OnePNC, VolumeVariables, OnePNCVolumeVariables<TypeTag>);           //!< the VolumeVariables property
-SET_TYPE_PROP(OnePNC, Indices, OnePNCIndices<GET_PROP_VALUE(TypeTag, PhaseIdx)>); //! The type encapsulating indices
 
-//! Set the vtk output fields specific to this model
-SET_PROP(OnePNC, VtkOutputFields)
+//! Set the volume variables property
+SET_PROP(OnePNC, VolumeVariables)
 {
 private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+    static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system");
+    static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state");
+
+    using Traits = OnePNCVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
 public:
-    using type = OnePNCVtkOutputFields<FluidSystem, phaseIdx>;
+    using type = OnePNCVolumeVariables<Traits>;
 };
 
+//! Set the vtk output fields specific to this model
+SET_TYPE_PROP(OnePNC, VtkOutputFields, OnePNCVtkOutputFields);
+
 ///////////////////////////////////////////////////////////////////////////
 // properties for the non-isothermal single phase model
 ///////////////////////////////////////////////////////////////////////////
 
 //! the non-isothermal vtk output fields
-SET_PROP(OnePNCNI, VtkOutputFields)
-{
-private:
-    static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
-    using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalFields = OnePNCVtkOutputFields<FluidSystem, phaseIdx>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
+SET_TYPE_PROP(OnePNCNI, VtkOutputFields, EnergyVtkOutputFields<OnePNCVtkOutputFields>);
 
 //! Use the average for effective conductivities
 SET_TYPE_PROP(OnePNCNI,
               ThermalConductivityModel,
               ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
-//! Indices of the non-isothermal model
-SET_PROP(OnePNCNI, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    using IsothermalIndices = OnePNCIndices<GET_PROP_VALUE(TypeTag, PhaseIdx)>;
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 //! model traits of the non-isothermal model.
 SET_PROP(OnePNCNI, ModelTraits)
 {
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem));
-    using IsothermalTraits = OnePNCModelTraits<FluidSystem::numComponents>;
+    using IsothermalTraits = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, PhaseIdx)>;
 public:
     using type = PorousMediumFlowNIModelTraits<IsothermalTraits>;
 };
diff --git a/dumux/porousmediumflow/1pnc/volumevariables.hh b/dumux/porousmediumflow/1pnc/volumevariables.hh
index 584592ca00d8b1ca0ed5961e93f00d6a6e51ff1b..c0312d5fea9809e154be2059276ad345b6eb926d 100644
--- a/dumux/porousmediumflow/1pnc/volumevariables.hh
+++ b/dumux/porousmediumflow/1pnc/volumevariables.hh
@@ -25,8 +25,6 @@
 #ifndef DUMUX_1PNC_VOLUME_VARIABLES_HH
 #define DUMUX_1PNC_VOLUME_VARIABLES_HH
 
-#include <dune/common/fvector.hh>
-#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/volumevariables.hh>
 
 namespace Dumux {
@@ -36,45 +34,39 @@ namespace Dumux {
  * \brief Contains the quantities which are are constant within a
  *        finite volume in the one-phase, n-component model.
  *
- * \note The return functions for the fluid state variables always forward to the actual
- *       fluid state using the phaseIdx from the DuMuX property system. Furthermore, the
- *       default value is not used, but is only here to enable calling these functions
- *       without handing in a phase index (as in a single-phasic context there is only one phase).
- *       This way one can use two-phase fluid systems for this one-phasic flow and transport
- *       model by specifying which phase is present through the DuMuX property system.
+ * \note The default value for the phase index given in the fluid property interfaces is not used,
+ *       but is only here to enable calling these functions without handing in a phase index
+ *       (as in a single-phasic context there is only one phase).
  */
-template <class TypeTag>
-class OnePNCVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class OnePNCVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, OnePNCVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, OnePNCVolumeVariables<Traits>>;
+
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using Idx = typename Traits::ModelTraits::Indices;
+    static constexpr int numComp = ParentType::numComponents();
 
     enum
     {
-        numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(),
-
-        phaseIdx = Indices::phaseIdx,
-        phaseCompIdx = Indices::phaseCompIdx,
+        fluidSystemPhaseIdx = Idx::fluidSystemPhaseIdx,
 
-        // primary variable indices
-        pressureIdx = Indices::pressureIdx,
-        firstMoleFracIdx = Indices::firstMoleFracIdx,
+        // pressure primary variable index
+        pressureIdx = Idx::pressureIdx,
 
+        // main component index
+        mainCompMoleOrMassFracIdx = fluidSystemPhaseIdx
     };
 
 public:
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    //! export fluid state type
+    using FluidState = typename Traits::FluidState;
+    //! export fluid system type
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export indices
+    using Indices = typename Traits::ModelTraits::Indices;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -85,11 +77,11 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume &scv)
+                const Scv &scv)
     {
         ParentType::update(elemSol, problem, element, scv);
 
@@ -102,21 +94,18 @@ public:
         // Could be avoided if diffusion coefficients also
         // became part of the fluid state.
         typename FluidSystem::ParameterCache paramCache;
-        paramCache.updatePhase(fluidState_, phaseIdx);
+        paramCache.updatePhase(fluidState_, fluidSystemPhaseIdx);
 
-        int compIIdx = phaseCompIdx;
-
-        for (unsigned int compJIdx = 0; compJIdx < numComponents; ++compJIdx)
+        int compIIdx = mainCompMoleOrMassFracIdx;
+        for (unsigned int compJIdx = 0; compJIdx < numComp; ++compJIdx)
         {
             diffCoeff_[compJIdx] = 0.0;
-            if(compIIdx!= compJIdx)
-                {
+            if(compIIdx != compJIdx)
                 diffCoeff_[compJIdx] = FluidSystem::binaryDiffusionCoefficient(fluidState_,
-                                                             paramCache,
-                                                             phaseIdx,
-                                                             compIIdx,
-                                                             compJIdx);
-                }
+                                                                               paramCache,
+                                                                               fluidSystemPhaseIdx,
+                                                                               compIIdx,
+                                                                               compJIdx);
         }
 
     }
@@ -131,50 +120,53 @@ public:
      * \param scv The sub-control volume
      * \param fluidState A container with the current (physical) state of the fluid
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static void completeFluidState(const ElemSol &elemSol,
                                    const Problem& problem,
                                    const Element& element,
-                                   const SubControlVolume &scv,
+                                   const Scv &scv,
                                    FluidState& fluidState)
 
     {
         Scalar t = ParentType::temperature(elemSol, problem, element, scv);
         fluidState.setTemperature(t);
-        fluidState.setSaturation(phaseIdx, 1.);
+        fluidState.setSaturation(fluidSystemPhaseIdx, 1.0);
 
         const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
-        fluidState.setPressure(phaseIdx, priVars[pressureIdx]);
+        fluidState.setPressure(fluidSystemPhaseIdx, priVars[pressureIdx]);
 
         // calculate the phase composition
-        Dune::FieldVector<Scalar, numComponents> moleFrac;
-
-        Scalar sumMoleFracNotWater = 0;
+        Dune::FieldVector<Scalar, numComp> moleFrac;
 
-        for (int compIdx=firstMoleFracIdx; compIdx<numComponents; ++compIdx){
-             moleFrac[compIdx] = priVars[compIdx];
-             sumMoleFracNotWater +=moleFrac[compIdx];
+        Scalar sumMoleFracNotMainComp = 0;
+        for (int compIdx = 0; compIdx < numComp; ++compIdx)
+        {
+            if (compIdx != mainCompMoleOrMassFracIdx)
+            {
+                moleFrac[compIdx] = priVars[compIdx];
+                sumMoleFracNotMainComp += moleFrac[compIdx];
             }
-        moleFrac[0] = 1- sumMoleFracNotWater;
+        }
+        moleFrac[mainCompMoleOrMassFracIdx] = 1- sumMoleFracNotMainComp;
 
         // Set fluid state mole fractions
-        for (int compIdx=0; compIdx<numComponents; ++compIdx)
+        for (int compIdx = 0; compIdx < numComp; ++compIdx)
         {
-            fluidState.setMoleFraction(phaseIdx, compIdx, moleFrac[compIdx]);
+            fluidState.setMoleFraction(fluidSystemPhaseIdx, compIdx, moleFrac[compIdx]);
         }
 
         typename FluidSystem::ParameterCache paramCache;
         paramCache.updateAll(fluidState);
 
-        Scalar rho = FluidSystem::density(fluidState, paramCache, phaseIdx);
-        Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx);
+        Scalar rho = FluidSystem::density(fluidState, paramCache, fluidSystemPhaseIdx);
+        Scalar mu = FluidSystem::viscosity(fluidState, paramCache, fluidSystemPhaseIdx);
 
-        fluidState.setDensity(phaseIdx, rho);
-        fluidState.setViscosity(phaseIdx, mu);
+        fluidState.setDensity(fluidSystemPhaseIdx, rho);
+        fluidState.setViscosity(fluidSystemPhaseIdx, mu);
 
         // compute and set the enthalpy
-        Scalar h = Implementation::enthalpy(fluidState, paramCache, phaseIdx);
-        fluidState.setEnthalpy(phaseIdx, h);
+        Scalar h = ParentType::enthalpy(fluidState, paramCache, fluidSystemPhaseIdx);
+        fluidState.setEnthalpy(fluidSystemPhaseIdx, h);
     }
 
     /*!
@@ -188,26 +180,22 @@ public:
      * \brief Return density \f$\mathrm{[kg/m^3]}\f$ the of the fluid phase.
      *
      * \note the phase index passed to this function is for compatibility reasons
-     *       with multiphasic models. We always forward to the fluid state with the
-     *       phaseIdx property (see class description).
+     *       with multiphasic models.
      */
-    Scalar density(int pIdx = phaseIdx) const
+    Scalar density(int phaseIdx = fluidSystemPhaseIdx) const
     {
-        assert(pIdx == phaseIdx);
-        return fluidState_.density(phaseIdx);
+        return fluidState_.density(fluidSystemPhaseIdx);
     }
 
     /*!
      * \brief Return molar density \f$\mathrm{[mol/m^3]}\f$ the of the fluid phase.
      *
      * \note the phase index passed to this function is for compatibility reasons
-     *       with multiphasic models. We always forward to the fluid state with the
-     *       phaseIdx property (see class description).
+     *       with multiphasic models.
      */
-    Scalar molarDensity(int pIdx = phaseIdx) const
+    Scalar molarDensity(int phaseIdx = fluidSystemPhaseIdx) const
     {
-        assert(pIdx == phaseIdx);
-        return fluidState_.molarDensity(phaseIdx);
+        return fluidState_.molarDensity(fluidSystemPhaseIdx);
     }
 
     /*!
@@ -216,7 +204,7 @@ public:
      * This method is here for compatibility reasons with other models. The saturation
      * is always 1.0 in a one-phasic context.
      */
-    Scalar saturation(int pIdx = phaseIdx) const
+    Scalar saturation(int phaseIdx = fluidSystemPhaseIdx) const
     { return 1.0; }
 
      /*!
@@ -226,15 +214,13 @@ public:
       * \param compIdx the index of the component
       *
       * \note the phase index passed to this function is for compatibility reasons
-      *       with multiphasic models. We always forward to the fluid state with the
-      *       phaseIdx property (see class description).
+      *       with multiphasic models.
       */
-     Scalar moleFraction(int pIdx, int compIdx) const
+     Scalar moleFraction(int phaseIdx, int compIdx) const
      {
          // make sure this is only called with admissible indices
-         assert(pIdx == phaseIdx);
-         assert(compIdx < numComponents);
-         return fluidState_.moleFraction(phaseIdx, compIdx);
+         assert(compIdx < numComp);
+         return fluidState_.moleFraction(fluidSystemPhaseIdx, compIdx);
      }
 
      /*!
@@ -244,15 +230,13 @@ public:
       * \param compIdx the index of the component
       *
       * \note the phase index passed to this function is for compatibility reasons
-      *       with multiphasic models. We always forward to the fluid state with the
-      *       phaseIdx property (see class description).
+      *       with multiphasic models.
       */
-     Scalar massFraction(int pIdx, int compIdx) const
+     Scalar massFraction(int phaseIdx, int compIdx) const
      {
          // make sure this is only called with admissible indices
-         assert(pIdx == phaseIdx);
-         assert(compIdx < numComponents);
-         return fluidState_.massFraction(phaseIdx, compIdx);
+         assert(compIdx < numComp);
+         return fluidState_.massFraction(fluidSystemPhaseIdx, compIdx);
      }
 
     /*!
@@ -262,13 +246,11 @@ public:
      * \param phaseIdx The phase index
      *
      * \note the phase index passed to this function is for compatibility reasons
-     *       with multiphasic models. We always forward to the fluid state with the
-     *       phaseIdx property (see class description).
+     *       with multiphasic models.
      */
-    Scalar pressure(int pIdx = phaseIdx) const
+    Scalar pressure(int phaseIdx = fluidSystemPhaseIdx) const
     {
-        assert(pIdx == phaseIdx);
-        return fluidState_.pressure(phaseIdx);
+        return fluidState_.pressure(fluidSystemPhaseIdx);
     }
 
     /*!
@@ -288,13 +270,11 @@ public:
      * The method is here for compatibility reasons with other models.
      *
      * \note the phase index passed to this function is for compatibility reasons
-     *       with multiphasic models. We always forward to the fluid state with the
-     *       phaseIdx property (see class description).
+     *       with multiphasic models.
      */
-    Scalar mobility(int pIdx = phaseIdx) const
+    Scalar mobility(int phaseIdx = fluidSystemPhaseIdx) const
     {
-        assert(pIdx == phaseIdx);
-        return 1.0/fluidState_.viscosity(phaseIdx);
+        return 1.0/fluidState_.viscosity(fluidSystemPhaseIdx);
     }
 
     /*!
@@ -302,13 +282,11 @@ public:
      *        control volume.
      *
      * \note the phase index passed to this function is for compatibility reasons
-     *       with multiphasic models. We always forward to the fluid state with the
-     *       phaseIdx property (see class description).
+     *       with multiphasic models.
      */
-    Scalar viscosity(int pIdx = phaseIdx) const
+    Scalar viscosity(int phaseIdx = fluidSystemPhaseIdx) const
     {
-        assert(pIdx == phaseIdx);
-        return fluidState_.viscosity(phaseIdx);
+        return fluidState_.viscosity(fluidSystemPhaseIdx);
     }
 
     /*!
@@ -320,10 +298,9 @@ public:
     /*!
      * \brief Return the binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ in the fluid.
      */
-    Scalar diffusionCoefficient(int pIdx, int compIdx) const
+    Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
     {
-        assert(pIdx == phaseIdx);
-        assert(compIdx < numComponents);
+        assert(compIdx < numComp);
         return diffCoeff_[compIdx];
     }
 
@@ -334,8 +311,8 @@ public:
      */
     Scalar molarity(int compIdx) const // [moles/m^3]
     {
-        assert(compIdx < numComponents);
-        return fluidState_.molarity(phaseIdx, compIdx);
+        assert(compIdx < numComp);
+        return fluidState_.molarity(fluidSystemPhaseIdx, compIdx);
     }
 
      /*!
@@ -345,8 +322,8 @@ public:
       */
      Scalar massFraction(int compIdx) const
      {
-         assert(compIdx < numComponents);
-         return this->fluidState_.massFraction(phaseIdx, compIdx);
+         assert(compIdx < numComp);
+         return this->fluidState_.massFraction(fluidSystemPhaseIdx, compIdx);
      }
 
     /*!
@@ -362,10 +339,9 @@ private:
     Scalar porosity_;        //!< Effective porosity within the control volume
     PermeabilityType permeability_;
     Scalar density_;
-    Dune::FieldVector<Scalar, numComponents> diffCoeff_;
-
+    Dune::FieldVector<Scalar, numComp> diffCoeff_;
 };
 
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/1pnc/vtkoutputfields.hh b/dumux/porousmediumflow/1pnc/vtkoutputfields.hh
index d95e1e8b99413cf409478ad16f57a2d57d9410f7..94d4d092142e4e0325b8391d750dbb1a4256f11c 100644
--- a/dumux/porousmediumflow/1pnc/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/1pnc/vtkoutputfields.hh
@@ -24,33 +24,33 @@
 #ifndef DUMUX_ONEPNC_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_ONEPNC_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
 namespace Dumux {
 
 /*!
  * \ingroup OnePNCModel
  * \brief Adds vtk output fields specific to the OnePNC model
  */
-template<class FluidSystem, int phaseIdx>
 class OnePNCVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
-        vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(phaseIdx); }, "pressure");
-        vtk.addVolumeVariable([](const auto& volVars){ return volVars.density(phaseIdx); }, "rho");
-        vtk.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(phaseIdx); }, "mu");
-        vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(phaseIdx) - 1e5; }, "delp");
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        using Indices = typename VolumeVariables::Indices;
+
+        vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(Indices::fluidSystemPhaseIdx); }, "pressure");
+        vtk.addVolumeVariable([](const auto& volVars){ return volVars.density(Indices::fluidSystemPhaseIdx); }, "rho");
+        vtk.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(Indices::fluidSystemPhaseIdx); }, "mu");
+        vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(Indices::fluidSystemPhaseIdx) - 1e5; }, "delp");
 
-        for (int i = 0; i < FluidSystem::numComponents; ++i)
-           vtk.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(phaseIdx, i); },
+        for (int i = 0; i < VolumeVariables::numComponents(); ++i)
+           vtk.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(Indices::fluidSystemPhaseIdx, i); },
                                      "x_" + std::string(FluidSystem::componentName(i)));
 
-        for (int i = 0; i < FluidSystem::numComponents; ++i)
-           vtk.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(phaseIdx,i); },
+        for (int i = 0; i < VolumeVariables::numComponents(); ++i)
+           vtk.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(Indices::fluidSystemPhaseIdx, i); },
                                      "X_" + std::string(FluidSystem::componentName(i)));
     }
 };
diff --git a/dumux/porousmediumflow/1pncmin/model.hh b/dumux/porousmediumflow/1pncmin/model.hh
index 1a12f098d587f0724b9629c995a89290f13d6e08..f484bc3c833b97bc67a9a416cf4c1b578c1ac284 100644
--- a/dumux/porousmediumflow/1pncmin/model.hh
+++ b/dumux/porousmediumflow/1pncmin/model.hh
@@ -98,9 +98,16 @@ NEW_TYPE_TAG(OnePNCMinNI, INHERITS_FROM(OnePNCMin));
 SET_PROP(OnePNCMin, VolumeVariables)
 {
 private:
-    using NonMinVolVars = OnePNCVolumeVariables<TypeTag>;
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = OnePNCVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+    using NonMinVolVars = OnePNCVolumeVariables<Traits>;
 public:
-    using type = MineralizationVolumeVariables<TypeTag, NonMinVolVars>;
+    using type = MineralizationVolumeVariables<Traits, NonMinVolVars>;
 };
 
 // Use the mineralization local residual
@@ -111,44 +118,27 @@ SET_PROP(OnePNCMin, ModelTraits)
 {
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem));
-    using NonMinTraits = OnePNCModelTraits<FluidSystem::numComponents>;
+    using NonMinTraits = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, PhaseIdx)>;
 public:
     using type = MineralizationModelTraits<NonMinTraits, FluidSystem::numSPhases>;
 };
 
 //! Use the mineralization vtk output fields
-SET_PROP(OnePNCMin, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
-   using NonMineralizationFields = OnePNCVtkOutputFields<FluidSystem, phaseIdx>;
-public:
-    using type = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>;
-};
+SET_TYPE_PROP(OnePNCMin, VtkOutputFields, MineralizationVtkOutputFields<OnePNCVtkOutputFields>);
 
 //////////////////////////////////////////////////////////////////
 // Properties for the non-isothermal 2pncmin model
 //////////////////////////////////////////////////////////////////
 
 //! non-isothermal vtk output
-SET_PROP(OnePNCMinNI, VtkOutputFields)
-{
-private:
-    using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
-    using NonMineralizationFields =  OnePNCVtkOutputFields<FluidSystem, phaseIdx>;
-    using IsothermalFields = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
+SET_TYPE_PROP(OnePNCMinNI, VtkOutputFields, EnergyVtkOutputFields<MineralizationVtkOutputFields<OnePNCVtkOutputFields>>);
 
 //! The non-isothermal model traits
 SET_PROP(OnePNCMinNI, ModelTraits)
 {
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem));
-    using OnePNCTraits = OnePNCModelTraits<FluidSystem::numComponents>;
+    using OnePNCTraits = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, PhaseIdx)>;
     using IsothermalTraits = MineralizationModelTraits<OnePNCTraits, FluidSystem::numSPhases>;
 public:
     using type = PorousMediumFlowNIModelTraits<IsothermalTraits>;
@@ -159,16 +149,6 @@ SET_TYPE_PROP(OnePNCMinNI,
               ThermalConductivityModel,
               ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
-//! Indices of the non-isothermal model
-SET_PROP(OnePNCMinNI, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    using IsothermalIndices = OnePNCIndices<GET_PROP_VALUE(TypeTag, PhaseIdx)>;
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 } // end namespace Properties
 } // end namespace Dumux
 
diff --git a/dumux/porousmediumflow/2p/formulation.hh b/dumux/porousmediumflow/2p/formulation.hh
new file mode 100644
index 0000000000000000000000000000000000000000..681324e06031737157a3d47a6eafeff91f1e87de
--- /dev/null
+++ b/dumux/porousmediumflow/2p/formulation.hh
@@ -0,0 +1,42 @@
+// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+// vi: set et ts=4 sw=4 sts=4:
+/*****************************************************************************
+ *   See the file COPYING for full copying permissions.                      *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+
+/*!
+ * \file
+ * \ingroup TwoPModel
+ * \brief Defines an enumeration for the formulations accepted by the two-phase model.
+ */
+#ifndef DUMUX_2P_FORMULATION_INDICES_HH
+#define DUMUX_2P_FORMULATION_INDICES_HH
+
+namespace Dumux {
+
+/*!
+ * \ingroup TwoPModel
+ * \brief Enumerates the formulations which the two-phase model accepts.
+ */
+enum class TwoPFormulation
+{
+    p0s1, //!< first phase pressure and second phase saturation as primary variables
+    p1s0  //!< first phase saturation and second phase pressure as primary variables
+};
+
+} // namespace Dumux
+
+#endif
diff --git a/dumux/porousmediumflow/2p/gridadaptindicator.hh b/dumux/porousmediumflow/2p/gridadaptindicator.hh
index 337c1aa2387f5abfbae6417d042fe798d98adacc..6208a8389f6a832125262bd776f57f09cb2036c7 100644
--- a/dumux/porousmediumflow/2p/gridadaptindicator.hh
+++ b/dumux/porousmediumflow/2p/gridadaptindicator.hh
@@ -46,7 +46,7 @@ class TwoPGridAdaptIndicator
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
 
     enum { saturationIdx = Indices::saturationIdx };
diff --git a/dumux/porousmediumflow/2p/griddatatransfer.hh b/dumux/porousmediumflow/2p/griddatatransfer.hh
index 475d140ebcc03b3ea3003109bd229b000983fd5a..748ffedeb9808c56e6523f13a45ba17bdb27f356 100644
--- a/dumux/porousmediumflow/2p/griddatatransfer.hh
+++ b/dumux/porousmediumflow/2p/griddatatransfer.hh
@@ -28,9 +28,12 @@
 
 #include <dune/grid/common/partitionset.hh>
 #include <dune/grid/utility/persistentcontainer.hh>
+
 #include <dumux/common/properties.hh>
+
 #include <dumux/discretization/methods.hh>
 #include <dumux/discretization/elementsolution.hh>
+#include <dumux/porousmediumflow/2p/formulation.hh>
 #include <dumux/adaptive/griddatatransfer.hh>
 
 namespace Dumux {
@@ -45,7 +48,6 @@ class TwoPGridDataTransfer : public GridDataTransfer
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using FVElementGeometry = typename FVGridGeometry::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
@@ -58,6 +60,8 @@ class TwoPGridDataTransfer : public GridDataTransfer
                                                                   std::declval<SolutionVector>(),
                                                                   std::declval<FVGridGeometry>()))>;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
     struct AdaptedValues
     {
@@ -74,30 +78,30 @@ class TwoPGridDataTransfer : public GridDataTransfer
     static constexpr int dimWorld = Grid::dimensionworld;
     static constexpr bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box;
 
-    // export some indices
-    enum {
-        // index of saturation in primary variables
-        saturationIdx = Indices::saturationIdx,
+    // saturation primary variable index
+    enum { saturationIdx = Indices::saturationIdx };
 
-        // phase indices
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+    // phase indices
+    enum
+    {
+        phase0Idx = FluidSystem::phase0Idx,
+        phase1Idx = FluidSystem::phase1Idx,
+    };
 
-        // formulations
-        pwsn = Indices::pwsn,
-        pnsw = Indices::pnsw,
+    // formulations
+    static constexpr auto p0s1 = TwoPFormulation::p0s1;
+    static constexpr auto p1s0 = TwoPFormulation::p1s0;
 
-        // the formulation that is actually used
-        formulation = GET_PROP_VALUE(TypeTag, Formulation)
-    };
+    // the formulation that is actually used
+    static constexpr auto formulation = ModelTraits::priVarFormulation();
 
     // This won't work (mass conservative) for compressible fluids
-    static_assert(!FluidSystem::isCompressible(wPhaseIdx)
-                  && !FluidSystem::isCompressible(nPhaseIdx),
+    static_assert(!FluidSystem::isCompressible(phase0Idx)
+                  && !FluidSystem::isCompressible(phase1Idx),
                   "This adaption helper is only mass conservative for incompressible fluids!");
 
     // check if the used formulation is implemented here
-    static_assert(formulation == pwsn || formulation == pnsw, "Chosen formulation not known to the TwoPGridDataTransfer");
+    static_assert(formulation == p0s1 || formulation == p1s0, "Chosen formulation not known to the TwoPGridDataTransfer");
 
 public:
     /*! \brief Constructor
@@ -154,8 +158,8 @@ public:
                         volVars.update(adaptedValues.u, *problem_, element, scv);
 
                         const auto poreVolume = scv.volume()*volVars.porosity();
-                        adaptedValues.associatedMass[nPhaseIdx] += poreVolume * volVars.density(nPhaseIdx) * volVars.saturation(nPhaseIdx);
-                        adaptedValues.associatedMass[wPhaseIdx] += poreVolume * volVars.density(wPhaseIdx) * volVars.saturation(wPhaseIdx);
+                        adaptedValues.associatedMass[phase1Idx] += poreVolume * volVars.density(phase1Idx) * volVars.saturation(phase1Idx);
+                        adaptedValues.associatedMass[phase0Idx] += poreVolume * volVars.density(phase0Idx) * volVars.saturation(phase0Idx);
                     }
 
                     // leaf elements always start with count = 1
@@ -239,15 +243,15 @@ public:
                         // only recalculate the saturations if element hasn't been leaf before adaptation
                         if (!adaptedValues.wasLeaf)
                         {
-                            if (formulation == pwsn)
+                            if (formulation == p0s1)
                             {
-                                sol_[dofIdxGlobal][saturationIdx] = adaptedValues.associatedMass[nPhaseIdx];
-                                sol_[dofIdxGlobal][saturationIdx] /= elementVolume * volVars.density(nPhaseIdx) * volVars.porosity();
+                                sol_[dofIdxGlobal][saturationIdx] = adaptedValues.associatedMass[phase1Idx];
+                                sol_[dofIdxGlobal][saturationIdx] /= elementVolume * volVars.density(phase1Idx) * volVars.porosity();
                             }
-                            else if (formulation == pnsw)
+                            else if (formulation == p1s0)
                             {
-                                sol_[dofIdxGlobal][saturationIdx] = adaptedValues.associatedMass[wPhaseIdx];
-                                sol_[dofIdxGlobal][saturationIdx] /= elementVolume * volVars.density(wPhaseIdx) * volVars.porosity();
+                                sol_[dofIdxGlobal][saturationIdx] = adaptedValues.associatedMass[phase0Idx];
+                                sol_[dofIdxGlobal][saturationIdx] /= elementVolume * volVars.density(phase0Idx) * volVars.porosity();
                             }
                         }
                     }
@@ -256,15 +260,15 @@ public:
                     else
                     {
                         const auto scvVolume = scv.volume();
-                        if (formulation == pwsn)
+                        if (formulation == p0s1)
                         {
-                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(nPhaseIdx) * volVars.porosity();
-                            associatedMass[dofIdxGlobal] += scvVolume / elementVolume * adaptedValues.associatedMass[nPhaseIdx];
+                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(phase1Idx) * volVars.porosity();
+                            associatedMass[dofIdxGlobal] += scvVolume / elementVolume * adaptedValues.associatedMass[phase1Idx];
                         }
-                        else if (formulation == pnsw)
+                        else if (formulation == p1s0)
                         {
-                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(wPhaseIdx) * volVars.porosity();
-                            associatedMass[dofIdxGlobal] += scvVolume / elementVolume * adaptedValues.associatedMass[wPhaseIdx];
+                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(phase0Idx) * volVars.porosity();
+                            associatedMass[dofIdxGlobal] += scvVolume / elementVolume * adaptedValues.associatedMass[phase0Idx];
                         }
                     }
                 }
@@ -285,10 +289,10 @@ public:
 
                     // obtain the mass contained in father
                     Scalar massFather = 0.0;
-                    if (formulation == pwsn)
-                        massFather = adaptedValuesFather.associatedMass[nPhaseIdx];
-                    else if (formulation == pnsw)
-                        massFather = adaptedValuesFather.associatedMass[wPhaseIdx];
+                    if (formulation == p0s1)
+                        massFather = adaptedValuesFather.associatedMass[phase1Idx];
+                    else if (formulation == p1s0)
+                        massFather = adaptedValuesFather.associatedMass[phase0Idx];
 
                     // obtain the element solution through the father
                     auto elemSolSon = adaptedValuesFather.u;
@@ -307,10 +311,10 @@ public:
 
                         // overwrite the saturation by a mass conservative one here
                         Scalar massCoeffSon = 0.0;
-                        if (formulation == pwsn)
-                            massCoeffSon = scv.volume() * volVars.density(nPhaseIdx) * volVars.porosity();
-                        else if (formulation == pnsw)
-                            massCoeffSon = scv.volume() * volVars.density(wPhaseIdx) * volVars.porosity();
+                        if (formulation == p0s1)
+                            massCoeffSon = scv.volume() * volVars.density(phase1Idx) * volVars.porosity();
+                        else if (formulation == p1s0)
+                            massCoeffSon = scv.volume() * volVars.density(phase0Idx) * volVars.porosity();
                         sol_[scv.dofIndex()][saturationIdx] = (scv.volume() / fatherElement.geometry().volume() * massFather)/massCoeffSon;
                     }
                 }
@@ -339,15 +343,15 @@ public:
 
                         const auto dofIdxGlobal = scv.dofIndex();
                         const auto scvVolume = scv.volume();
-                        if (int(formulation) == pwsn)
+                        if (formulation == p0s1)
                         {
-                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(nPhaseIdx) * volVars.porosity();
-                            associatedMass[dofIdxGlobal] += scvVolume / fatherElementVolume * adaptedValuesFather.associatedMass[nPhaseIdx];
+                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(phase1Idx) * volVars.porosity();
+                            associatedMass[dofIdxGlobal] += scvVolume / fatherElementVolume * adaptedValuesFather.associatedMass[phase1Idx];
                         }
-                        else if (int(formulation) == pnsw)
+                        else if (formulation == p1s0)
                         {
-                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(wPhaseIdx) * volVars.porosity();
-                            associatedMass[dofIdxGlobal] += scvVolume / fatherElementVolume * adaptedValuesFather.associatedMass[wPhaseIdx];
+                            massCoeff[dofIdxGlobal] += scvVolume * volVars.density(phase0Idx) * volVars.porosity();
+                            associatedMass[dofIdxGlobal] += scvVolume / fatherElementVolume * adaptedValuesFather.associatedMass[phase0Idx];
                         }
 
                         // store constructed (pressure) values of son in the current solution (saturation comes later)
diff --git a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh
index ebc00a415e5cc9e5ad7a26fe043fdf4a9b3c11bc..421b5ce7af25fdc5018db0e6b7f4730f930d9b31 100644
--- a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh
+++ b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh
@@ -26,11 +26,15 @@
 #define DUMUX_2P_INCOMPRESSIBLE_TEST_LOCAL_RESIDUAL_HH
 
 #include <cmath>
+
 #include <dumux/common/properties.hh>
 #include <dumux/common/parameters.hh>
+
 #include <dumux/discretization/methods.hh>
 #include <dumux/discretization/elementsolution.hh>
+
 #include <dumux/porousmediumflow/immiscible/localresidual.hh>
+#include <dumux/porousmediumflow/2p/formulation.hh>
 
 namespace Dumux {
 
@@ -58,16 +62,12 @@ class TwoPIncompressibleLocalResidual : public ImmiscibleLocalResidual<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    // first index for the mass balance
-    enum
-    {
-        contiWEqIdx = Indices::contiWEqIdx,
-        contiNEqIdx = Indices::contiNEqIdx,
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
 
-        pressureIdx = Indices::pressureIdx,
-        saturationIdx = Indices::saturationIdx
-    };
+    static constexpr int numPhases = ModelTraits::numPhases();
+    static constexpr int pressureIdx = ModelTraits::Indices::pressureIdx;
+    static constexpr int saturationIdx = ModelTraits::Indices::saturationIdx;
+    static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx;
 
 public:
     using ParentType::ParentType;
@@ -93,26 +93,26 @@ public:
                                const VolumeVariables& curVolVars,
                                const SubControlVolume& scv) const
     {
-        static_assert(!FluidSystem::isCompressible(FluidSystem::wPhaseIdx),
+        static_assert(!FluidSystem::isCompressible(0),
                       "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!");
-        static_assert(!FluidSystem::isCompressible(FluidSystem::nPhaseIdx),
+        static_assert(!FluidSystem::isCompressible(1),
                       "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!");
+        static_assert(ModelTraits::numPhases() == 2,
+                      "2p/incompressiblelocalresidual.hh: Only two-phase models are allowed!");
+        static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1,
+                      "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p1-s0 formulation!");
 
         // we know that these values are constant throughout the simulation
-        static const auto phi = curVolVars.porosity();
-        static const auto phi_rho_w = phi*curVolVars.density(FluidSystem::wPhaseIdx);
-        static const auto phi_rho_n = phi*curVolVars.density(FluidSystem::nPhaseIdx);
-
-        const auto volume = scv.volume();
-
-        // partial derivative of wetting phase storage term w.r.t. p_w
-        partialDerivatives[contiWEqIdx][pressureIdx] += 0.0;
-        // partial derivative of wetting phase storage term w.r.t. S_n
-        partialDerivatives[contiWEqIdx][saturationIdx] -= volume*phi_rho_w/this->timeLoop().timeStepSize();
-        // partial derivative of non-wetting phase storage term w.r.t. p_w
-        partialDerivatives[contiNEqIdx][pressureIdx] += 0.0;
-        // partial derivative of non-wetting phase storage term w.r.t. S_n
-        partialDerivatives[contiNEqIdx][saturationIdx] += volume*phi_rho_n/this->timeLoop().timeStepSize();
+        const auto poreVolume = scv.volume()*curVolVars.porosity();
+        static const std::array<Scalar, numPhases> rhos = { curVolVars.density(0), curVolVars.density(1) };
+
+        for (int pIdx = 0; pIdx < ModelTraits::numPhases(); ++pIdx)
+        {
+            // partial derivative of wetting phase storage term w.r.t. p_w
+            partialDerivatives[conti0EqIdx+pIdx][pressureIdx] += 0.0;
+            // partial derivative of wetting phase storage term w.r.t. S_n
+            partialDerivatives[conti0EqIdx+pIdx][saturationIdx] -= poreVolume*rhos[pIdx]/this->timeLoop().timeStepSize();
+        }
     }
 
     /*!
@@ -157,24 +157,26 @@ public:
                        const ElementFluxVariablesCache& elemFluxVarsCache,
                        const SubControlVolumeFace& scvf) const
     {
-        static_assert(!FluidSystem::isCompressible(FluidSystem::wPhaseIdx),
+        static_assert(!FluidSystem::isCompressible(0),
                       "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!");
-        static_assert(!FluidSystem::isCompressible(FluidSystem::nPhaseIdx),
+        static_assert(!FluidSystem::isCompressible(1),
                       "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!");
-        static_assert(FluidSystem::viscosityIsConstant(FluidSystem::wPhaseIdx),
+        static_assert(FluidSystem::viscosityIsConstant(0),
                       "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!");
-        static_assert(FluidSystem::viscosityIsConstant(FluidSystem::nPhaseIdx),
+        static_assert(FluidSystem::viscosityIsConstant(1),
                       "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!");
+        static_assert(ModelTraits::numPhases() == 2,
+                      "2p/incompressiblelocalresidual.hh: Only two-phase models are allowed!");
+        static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1,
+                      "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p1-s0 formulation!");
 
         using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
         using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType);
 
         // evaluate the current wetting phase Darcy flux and resulting upwind weights
-        static const Scalar upwindWeight = getParam<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Implicit.UpwindWeight");
-        const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars,
-                                                scvf, FluidSystem::wPhaseIdx, elemFluxVarsCache);
-        const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars,
-                                                scvf, FluidSystem::nPhaseIdx, elemFluxVarsCache);
+        static const Scalar upwindWeight = getParamFromGroup<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Implicit.UpwindWeight");
+        const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 0, elemFluxVarsCache);
+        const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 1, elemFluxVarsCache);
         const auto insideWeight_w = std::signbit(flux_w) ? (1.0 - upwindWeight) : upwindWeight;
         const auto outsideWeight_w = 1.0 - insideWeight_w;
         const auto insideWeight_n = std::signbit(flux_n) ? (1.0 - upwindWeight) : upwindWeight;
@@ -200,18 +202,18 @@ public:
         auto& dI_dJ = derivativeMatrices[outsideScvIdx];
 
         // some quantities to be reused (rho & mu are constant and thus equal for all cells)
-        static const auto rho_w = insideVolVars.density(FluidSystem::wPhaseIdx);
-        static const auto rho_n = insideVolVars.density(FluidSystem::nPhaseIdx);
-        static const auto rhow_muw = rho_w/insideVolVars.viscosity(FluidSystem::wPhaseIdx);
-        static const auto rhon_mun = rho_n/insideVolVars.viscosity(FluidSystem::nPhaseIdx);
-        const auto rhowKrw_muw_inside = rho_w*insideVolVars.mobility(FluidSystem::wPhaseIdx);
-        const auto rhonKrn_mun_inside = rho_n*insideVolVars.mobility(FluidSystem::nPhaseIdx);
-        const auto rhowKrw_muw_outside = rho_w*outsideVolVars.mobility(FluidSystem::wPhaseIdx);
-        const auto rhonKrn_mun_outside = rho_n*outsideVolVars.mobility(FluidSystem::nPhaseIdx);
+        static const auto rho_w = insideVolVars.density(0);
+        static const auto rho_n = insideVolVars.density(1);
+        static const auto rhow_muw = rho_w/insideVolVars.viscosity(0);
+        static const auto rhon_mun = rho_n/insideVolVars.viscosity(1);
+        const auto rhowKrw_muw_inside = rho_w*insideVolVars.mobility(0);
+        const auto rhonKrn_mun_inside = rho_n*insideVolVars.mobility(1);
+        const auto rhowKrw_muw_outside = rho_w*outsideVolVars.mobility(0);
+        const auto rhonKrn_mun_outside = rho_n*outsideVolVars.mobility(1);
 
         // derivative w.r.t. to Sn is the negative of the one w.r.t. Sw
-        const auto insideSw = insideVolVars.saturation(FluidSystem::wPhaseIdx);
-        const auto outsideSw = outsideVolVars.saturation(FluidSystem::wPhaseIdx);
+        const auto insideSw = insideVolVars.saturation(0);
+        const auto outsideSw = outsideVolVars.saturation(0);
         const auto dKrw_dSn_inside = MaterialLaw::dkrw_dsw(insideMaterialParams, insideSw);
         const auto dKrw_dSn_outside = MaterialLaw::dkrw_dsw(outsideMaterialParams, outsideSw);
         const auto dKrn_dSn_inside = MaterialLaw::dkrn_dsw(insideMaterialParams, insideSw);
@@ -230,24 +232,24 @@ public:
         const auto tij_up_n = tij*up_n;
 
         // partial derivative of the wetting phase flux w.r.t. p_w
-        dI_dI[contiWEqIdx][pressureIdx] += tij_up_w;
-        dI_dJ[contiWEqIdx][pressureIdx] -= tij_up_w;
+        dI_dI[conti0EqIdx+0][pressureIdx] += tij_up_w;
+        dI_dJ[conti0EqIdx+0][pressureIdx] -= tij_up_w;
 
         // partial derivative of the wetting phase flux w.r.t. S_n
-        dI_dI[contiWEqIdx][saturationIdx] -= rho_mu_flux_w*dKrw_dSn_inside*insideWeight_w;
-        dI_dJ[contiWEqIdx][saturationIdx] -= rho_mu_flux_w*dKrw_dSn_outside*outsideWeight_w;
+        dI_dI[conti0EqIdx+0][saturationIdx] -= rho_mu_flux_w*dKrw_dSn_inside*insideWeight_w;
+        dI_dJ[conti0EqIdx+0][saturationIdx] -= rho_mu_flux_w*dKrw_dSn_outside*outsideWeight_w;
 
         // partial derivative of the non-wetting phase flux w.r.t. p_w
-        dI_dI[contiNEqIdx][pressureIdx] += tij_up_n;
-        dI_dJ[contiNEqIdx][pressureIdx] -= tij_up_n;
+        dI_dI[conti0EqIdx+1][pressureIdx] += tij_up_n;
+        dI_dJ[conti0EqIdx+1][pressureIdx] -= tij_up_n;
 
         // partial derivative of the non-wetting phase flux w.r.t. S_n (relative permeability derivative contribution)
-        dI_dI[contiNEqIdx][saturationIdx] -= rho_mu_flux_n*dKrn_dSn_inside*insideWeight_n;
-        dI_dJ[contiNEqIdx][saturationIdx] -= rho_mu_flux_n*dKrn_dSn_outside*outsideWeight_n;
+        dI_dI[conti0EqIdx+1][saturationIdx] -= rho_mu_flux_n*dKrn_dSn_inside*insideWeight_n;
+        dI_dJ[conti0EqIdx+1][saturationIdx] -= rho_mu_flux_n*dKrn_dSn_outside*outsideWeight_n;
 
         // partial derivative of the non-wetting phase flux w.r.t. S_n (capillary pressure derivative contribution)
-        dI_dI[contiNEqIdx][saturationIdx] -= tij_up_n*dpc_dSn_inside;
-        dI_dJ[contiNEqIdx][saturationIdx] += tij_up_n*dpc_dSn_outside;
+        dI_dI[conti0EqIdx+1][saturationIdx] -= tij_up_n*dpc_dSn_inside;
+        dI_dJ[conti0EqIdx+1][saturationIdx] += tij_up_n*dpc_dSn_outside;
     }
 
     /*!
@@ -273,24 +275,26 @@ public:
                        const ElementFluxVariablesCache& elemFluxVarsCache,
                        const SubControlVolumeFace& scvf) const
     {
-        static_assert(!FluidSystem::isCompressible(FluidSystem::wPhaseIdx),
+        static_assert(!FluidSystem::isCompressible(0),
                       "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!");
-        static_assert(!FluidSystem::isCompressible(FluidSystem::nPhaseIdx),
+        static_assert(!FluidSystem::isCompressible(1),
                       "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!");
-        static_assert(FluidSystem::viscosityIsConstant(FluidSystem::wPhaseIdx),
+        static_assert(FluidSystem::viscosityIsConstant(0),
                       "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!");
-        static_assert(FluidSystem::viscosityIsConstant(FluidSystem::nPhaseIdx),
+        static_assert(FluidSystem::viscosityIsConstant(1),
                       "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!");
+        static_assert(ModelTraits::numPhases() == 2,
+                      "2p/incompressiblelocalresidual.hh: Only two-phase models are allowed!");
+        static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1,
+                      "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p0-s1 formulation!");
 
         using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
         using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType);
 
         // evaluate the current wetting phase Darcy flux and resulting upwind weights
-        static const Scalar upwindWeight = getParam<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Implicit.UpwindWeight");
-        const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars,
-                                                scvf, FluidSystem::wPhaseIdx, elemFluxVarsCache);
-        const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars,
-                                                scvf, FluidSystem::nPhaseIdx, elemFluxVarsCache);
+        static const Scalar upwindWeight = getParamFromGroup<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Implicit.UpwindWeight");
+        const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 0, elemFluxVarsCache);
+        const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 1, elemFluxVarsCache);
         const auto insideWeight_w = std::signbit(flux_w) ? (1.0 - upwindWeight) : upwindWeight;
         const auto outsideWeight_w = 1.0 - insideWeight_w;
         const auto insideWeight_n = std::signbit(flux_n) ? (1.0 - upwindWeight) : upwindWeight;
@@ -310,14 +314,14 @@ public:
         const auto& outsideMaterialParams = problem.spatialParams().materialLawParams(element, outsideScv, elemSol);
 
         // some quantities to be reused (rho & mu are constant and thus equal for all cells)
-        static const auto rho_w = insideVolVars.density(FluidSystem::wPhaseIdx);
-        static const auto rho_n = insideVolVars.density(FluidSystem::nPhaseIdx);
-        static const auto rhow_muw = rho_w/insideVolVars.viscosity(FluidSystem::wPhaseIdx);
-        static const auto rhon_mun = rho_n/insideVolVars.viscosity(FluidSystem::nPhaseIdx);
-        const auto rhowKrw_muw_inside = rho_w*insideVolVars.mobility(FluidSystem::wPhaseIdx);
-        const auto rhonKrn_mun_inside = rho_n*insideVolVars.mobility(FluidSystem::nPhaseIdx);
-        const auto rhowKrw_muw_outside = rho_w*outsideVolVars.mobility(FluidSystem::wPhaseIdx);
-        const auto rhonKrn_mun_outside = rho_n*outsideVolVars.mobility(FluidSystem::nPhaseIdx);
+        static const auto rho_w = insideVolVars.density(0);
+        static const auto rho_n = insideVolVars.density(1);
+        static const auto rhow_muw = rho_w/insideVolVars.viscosity(0);
+        static const auto rhon_mun = rho_n/insideVolVars.viscosity(1);
+        const auto rhowKrw_muw_inside = rho_w*insideVolVars.mobility(0);
+        const auto rhonKrn_mun_inside = rho_n*insideVolVars.mobility(1);
+        const auto rhowKrw_muw_outside = rho_w*outsideVolVars.mobility(0);
+        const auto rhonKrn_mun_outside = rho_n*outsideVolVars.mobility(1);
 
         // let the Law for the advective fluxes calculate the transmissibilities
         const auto ti = AdvectionType::calculateTransmissibilities(problem,
@@ -348,61 +352,61 @@ public:
 
             // partial derivative of the wetting phase flux w.r.t. p_w
             const auto tj_up_w = tj*up_w;
-            dI_dJ_inside[globalJ][contiWEqIdx][pressureIdx] += tj_up_w;
-            dI_dJ_outside[globalJ][contiWEqIdx][pressureIdx] -= tj_up_w;
+            dI_dJ_inside[globalJ][conti0EqIdx+0][pressureIdx] += tj_up_w;
+            dI_dJ_outside[globalJ][conti0EqIdx+0][pressureIdx] -= tj_up_w;
 
             // partial derivative of the non-wetting phase flux w.r.t. p_w
             const auto tj_up_n = tj*up_n;
-            dI_dJ_inside[globalJ][contiNEqIdx][pressureIdx] += tj_up_n;
-            dI_dJ_outside[globalJ][contiNEqIdx][pressureIdx] -= tj_up_n;
+            dI_dJ_inside[globalJ][conti0EqIdx+1][pressureIdx] += tj_up_n;
+            dI_dJ_outside[globalJ][conti0EqIdx+1][pressureIdx] -= tj_up_n;
 
             // partial derivatives w.r.t. S_n (are the negative of those w.r.t sw)
             // relative permeability contributions only for inside/outside
             if (localJ == insideScvIdx)
             {
                 // partial derivative of the wetting phase flux w.r.t. S_n
-                const auto insideSw = insideVolVars.saturation(FluidSystem::wPhaseIdx);
+                const auto insideSw = insideVolVars.saturation(0);
                 const auto dKrw_dSn_inside = MaterialLaw::dkrw_dsw(insideMaterialParams, insideSw);
                 const auto dFluxW_dSnJ = rho_mu_flux_w*dKrw_dSn_inside*insideWeight_w;
-                dI_dJ_inside[globalJ][contiWEqIdx][saturationIdx] -= dFluxW_dSnJ;
-                dI_dJ_outside[globalJ][contiWEqIdx][saturationIdx] += dFluxW_dSnJ;
+                dI_dJ_inside[globalJ][conti0EqIdx+0][saturationIdx] -= dFluxW_dSnJ;
+                dI_dJ_outside[globalJ][conti0EqIdx+0][saturationIdx] += dFluxW_dSnJ;
 
                 // partial derivative of the non-wetting phase flux w.r.t. S_n (k_rn contribution)
                 const auto dKrn_dSn_inside = MaterialLaw::dkrn_dsw(insideMaterialParams, insideSw);
                 const auto dFluxN_dSnJ_krn = rho_mu_flux_n*dKrn_dSn_inside*insideWeight_n;
-                dI_dJ_inside[globalJ][contiNEqIdx][saturationIdx] -= dFluxN_dSnJ_krn;
-                dI_dJ_outside[globalJ][contiWEqIdx][saturationIdx] += dFluxN_dSnJ_krn;
+                dI_dJ_inside[globalJ][conti0EqIdx+1][saturationIdx] -= dFluxN_dSnJ_krn;
+                dI_dJ_outside[globalJ][conti0EqIdx+0][saturationIdx] += dFluxN_dSnJ_krn;
 
                 // partial derivative of the non-wetting phase flux w.r.t. S_n (p_c contribution)
                 const auto dFluxN_dSnJ_pc = tj_up_n*MaterialLaw::dpc_dsw(insideMaterialParams, insideSw);
-                dI_dJ_inside[globalJ][contiNEqIdx][saturationIdx] -= dFluxN_dSnJ_pc;
-                dI_dJ_outside[globalJ][contiNEqIdx][saturationIdx] += dFluxN_dSnJ_pc;
+                dI_dJ_inside[globalJ][conti0EqIdx+1][saturationIdx] -= dFluxN_dSnJ_pc;
+                dI_dJ_outside[globalJ][conti0EqIdx+1][saturationIdx] += dFluxN_dSnJ_pc;
             }
             else if (localJ == outsideScvIdx)
             {
                 // see comments for (globalJ == insideScvIdx)
-                const auto outsideSw = outsideVolVars.saturation(FluidSystem::wPhaseIdx);
+                const auto outsideSw = outsideVolVars.saturation(0);
                 const auto dKrw_dSn_outside = MaterialLaw::dkrw_dsw(outsideMaterialParams, outsideSw);
                 const auto dFluxW_dSnJ = rho_mu_flux_w*dKrw_dSn_outside*outsideWeight_w;
-                dI_dJ_inside[globalJ][contiWEqIdx][saturationIdx] -= dFluxW_dSnJ;
-                dI_dJ_outside[globalJ][contiWEqIdx][saturationIdx] += dFluxW_dSnJ;
+                dI_dJ_inside[globalJ][conti0EqIdx+0][saturationIdx] -= dFluxW_dSnJ;
+                dI_dJ_outside[globalJ][conti0EqIdx+0][saturationIdx] += dFluxW_dSnJ;
 
                 const auto dKrn_dSn_outside = MaterialLaw::dkrn_dsw(outsideMaterialParams, outsideSw);
                 const auto dFluxN_dSnJ_krn = rho_mu_flux_n*dKrn_dSn_outside*outsideWeight_n;
-                dI_dJ_inside[globalJ][contiNEqIdx][saturationIdx] -= dFluxN_dSnJ_krn;
-                dI_dJ_outside[globalJ][contiNEqIdx][saturationIdx] += dFluxN_dSnJ_krn;
+                dI_dJ_inside[globalJ][conti0EqIdx+1][saturationIdx] -= dFluxN_dSnJ_krn;
+                dI_dJ_outside[globalJ][conti0EqIdx+1][saturationIdx] += dFluxN_dSnJ_krn;
 
                 const auto dFluxN_dSnJ_pc = tj_up_n*MaterialLaw::dpc_dsw(outsideMaterialParams, outsideSw);
-                dI_dJ_inside[globalJ][contiNEqIdx][saturationIdx] -= dFluxN_dSnJ_pc;
-                dI_dJ_outside[globalJ][contiNEqIdx][saturationIdx] += dFluxN_dSnJ_pc;
+                dI_dJ_inside[globalJ][conti0EqIdx+1][saturationIdx] -= dFluxN_dSnJ_pc;
+                dI_dJ_outside[globalJ][conti0EqIdx+1][saturationIdx] += dFluxN_dSnJ_pc;
             }
             else
             {
                 const auto& paramsJ = problem.spatialParams().materialLawParams(element, scvJ, elemSol);
-                const auto swJ = curElemVolVars[scvJ].saturation(FluidSystem::wPhaseIdx);
+                const auto swJ = curElemVolVars[scvJ].saturation(0);
                 const auto dFluxN_dSnJ_pc = tj_up_n*MaterialLaw::dpc_dsw(paramsJ, swJ);
-                dI_dJ_inside[globalJ][contiNEqIdx][saturationIdx] -= dFluxN_dSnJ_pc;
-                dI_dJ_outside[globalJ][contiNEqIdx][saturationIdx] += dFluxN_dSnJ_pc;
+                dI_dJ_inside[globalJ][conti0EqIdx+1][saturationIdx] -= dFluxN_dSnJ_pc;
+                dI_dJ_outside[globalJ][conti0EqIdx+1][saturationIdx] += dFluxN_dSnJ_pc;
             }
         }
     }
@@ -433,11 +437,9 @@ public:
         using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType);
 
         // evaluate the current wetting phase Darcy flux and resulting upwind weights
-        static const Scalar upwindWeight = getParam<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Implicit.UpwindWeight");
-        const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars,
-                                                     scvf, FluidSystem::wPhaseIdx, elemFluxVarsCache);
-        const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars,
-                                                        scvf, FluidSystem::nPhaseIdx, elemFluxVarsCache);
+        static const Scalar upwindWeight = getParamFromGroup<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Implicit.UpwindWeight");
+        const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 0, elemFluxVarsCache);
+        const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 1, elemFluxVarsCache);
         const auto insideWeight_w = std::signbit(flux_w) ? (1.0 - upwindWeight) : upwindWeight;
         const auto outsideWeight_w = 1.0 - insideWeight_w;
         const auto insideWeight_n = std::signbit(flux_n) ? (1.0 - upwindWeight) : upwindWeight;
@@ -453,20 +455,20 @@ public:
                                                                                      elementSolution<FVElementGeometry>(insideVolVars.priVars()));
 
         // some quantities to be reused (rho & mu are constant and thus equal for all cells)
-        static const auto rho_w = insideVolVars.density(FluidSystem::wPhaseIdx);
-        static const auto rho_n = insideVolVars.density(FluidSystem::nPhaseIdx);
-        static const auto rhow_muw = rho_w/insideVolVars.viscosity(FluidSystem::wPhaseIdx);
-        static const auto rhon_mun = rho_n/insideVolVars.viscosity(FluidSystem::nPhaseIdx);
-        const auto rhowKrw_muw_inside = rho_w*insideVolVars.mobility(FluidSystem::wPhaseIdx);
-        const auto rhonKrn_mun_inside = rho_n*insideVolVars.mobility(FluidSystem::nPhaseIdx);
-        const auto rhowKrw_muw_outside = rho_w*outsideVolVars.mobility(FluidSystem::wPhaseIdx);
-        const auto rhonKrn_mun_outside = rho_n*outsideVolVars.mobility(FluidSystem::nPhaseIdx);
+        static const auto rho_w = insideVolVars.density(0);
+        static const auto rho_n = insideVolVars.density(1);
+        static const auto rhow_muw = rho_w/insideVolVars.viscosity(0);
+        static const auto rhon_mun = rho_n/insideVolVars.viscosity(1);
+        const auto rhowKrw_muw_inside = rho_w*insideVolVars.mobility(0);
+        const auto rhonKrn_mun_inside = rho_n*insideVolVars.mobility(1);
+        const auto rhowKrw_muw_outside = rho_w*outsideVolVars.mobility(0);
+        const auto rhonKrn_mun_outside = rho_n*outsideVolVars.mobility(1);
 
         // get reference to the inside derivative matrix
         auto& dI_dI = derivativeMatrices[insideScvIdx];
 
         // derivative w.r.t. to Sn is the negative of the one w.r.t. Sw
-        const auto insideSw = insideVolVars.saturation(FluidSystem::wPhaseIdx);
+        const auto insideSw = insideVolVars.saturation(0);
         const auto dKrw_dSn_inside = -1.0*MaterialLaw::dkrw_dsw(insideMaterialParams, insideSw);
         const auto dKrn_dSn_inside = -1.0*MaterialLaw::dkrn_dsw(insideMaterialParams, insideSw);
         const auto dpc_dSn_inside = -1.0*MaterialLaw::dpc_dsw(insideMaterialParams, insideSw);
@@ -474,20 +476,20 @@ public:
         const auto tij = elemFluxVarsCache[scvf].advectionTij();
         // partial derivative of the wetting phase flux w.r.t. p_w
         const auto up_w = rhowKrw_muw_inside*insideWeight_w + rhowKrw_muw_outside*outsideWeight_w;
-        dI_dI[contiWEqIdx][pressureIdx] += tij*up_w;
+        dI_dI[conti0EqIdx+0][pressureIdx] += tij*up_w;
 
         // partial derivative of the wetting phase flux w.r.t. S_n
-        dI_dI[contiWEqIdx][saturationIdx] += rhow_muw*flux_w*dKrw_dSn_inside*insideWeight_w;
+        dI_dI[conti0EqIdx+0][saturationIdx] += rhow_muw*flux_w*dKrw_dSn_inside*insideWeight_w;
 
         // partial derivative of the non-wetting phase flux w.r.t. p_w
         const auto up_n = rhonKrn_mun_inside*insideWeight_n + rhonKrn_mun_outside*outsideWeight_n;
-        dI_dI[contiNEqIdx][pressureIdx] += tij*up_n;
+        dI_dI[conti0EqIdx+1][pressureIdx] += tij*up_n;
 
         // partial derivative of the non-wetting phase flux w.r.t. S_n (relative permeability derivative contribution)
-        dI_dI[contiNEqIdx][saturationIdx] += rhon_mun*flux_n*dKrn_dSn_inside*insideWeight_n;
+        dI_dI[conti0EqIdx+1][saturationIdx] += rhon_mun*flux_n*dKrn_dSn_inside*insideWeight_n;
 
         // partial derivative of the non-wetting phase flux w.r.t. S_n (capillary pressure derivative contribution)
-        dI_dI[contiNEqIdx][saturationIdx] += tij*dpc_dSn_inside*up_n;
+        dI_dI[conti0EqIdx+1][saturationIdx] += tij*dpc_dSn_inside*up_n;
     }
 
     /*!
diff --git a/dumux/porousmediumflow/2p/indices.hh b/dumux/porousmediumflow/2p/indices.hh
index 08c97b4994a22cf40fb60168138145be5e39c3c9..057dcacc5ef7e7f68f8b9b5c025dd18bfad70fca 100644
--- a/dumux/porousmediumflow/2p/indices.hh
+++ b/dumux/porousmediumflow/2p/indices.hh
@@ -22,88 +22,27 @@
  * \ingroup TwoPModel
  * \brief Defines the indices required for the two-phase fully implicit model.
  */
-#ifndef DUMUX_BOX_2P_INDICES_HH
-#define DUMUX_BOX_2P_INDICES_HH
+#ifndef DUMUX_2P_INDICES_HH
+#define DUMUX_2P_INDICES_HH
 
-#include <dumux/common/properties.hh>
+#include "formulation.hh"
 
-namespace Dumux
-{
-// \{
-
-/*!
- * \ingroup TwoPModel
- * \brief Enumerates the formulations which the two-phase model accepts.
- */
-struct TwoPFormulation
-{
-    static const int pwsn = 0; //!< pw and sn as primary variables
-    static const int pnsw = 1; //!< pn and sw as primary variables
-};
+namespace Dumux {
 
 /*!
  * \ingroup TwoPModel
  * \brief Defines the indices required for the two-phase fully implicit model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class FluidSystem, int PVOffset = 0>
-struct TwoPCommonIndices
+struct TwoPIndices
 {
-    // Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< index of the wetting phase
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< index of the non-wetting phase
-
     // Primary variable indices
-    static const int pressureIdx = PVOffset + 0; //!< index for wetting/non-wetting phase pressure (depending on formulation) in a solution vector
-    static const int saturationIdx = PVOffset + 1; //!< index of the saturation of the non-wetting/wetting phase
+    static constexpr int pressureIdx = 0; //!< index for first/second phase pressure (depending on formulation) in a solution vector
+    static constexpr int saturationIdx = 1; //!< index of the saturation of the first/second phase
 
     // indices of the equations
-    static const int conti0EqIdx = PVOffset + 0; //!< index of the first continuity equation
-    static const int contiWEqIdx = PVOffset + 0; //!< index of the continuity equation of the wetting phase
-    static const int contiNEqIdx = PVOffset + 1; //!< index of the continuity equation of the non-wetting phase
-};
-
-
-/*!
- * \ingroup TwoPModel
- * \brief The indices for the \f$p_w-S_n\f$ formulation of the
- *        isothermal two-phase model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam formulation The formulation, either pwsn or pnsw
- * \tparam PVOffset The first index in a primary variable vector.
- */
-template <class FluidSystem,
-          int formulation = TwoPFormulation::pwsn,
-          int PVOffset = 0>
-struct TwoPIndices
-: public TwoPCommonIndices<FluidSystem, PVOffset>, TwoPFormulation
-{
-    // indices of the primary variables
-    static const int pwIdx = PVOffset + 0; //!< index of the wetting phase pressure
-    static const int snIdx = PVOffset + 1; //!< index of the nonwetting phase saturation
-};
-
-/*!
- * \ingroup TwoPModel
- * \brief The indices for the \f$p_n-S_w\f$ formulation of the
- *        isothermal two-phase model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
- */
-template <class FluidSystem, int PVOffset>
-struct TwoPIndices<FluidSystem, TwoPFormulation::pnsw, PVOffset>
-: public TwoPCommonIndices<FluidSystem, PVOffset>, TwoPFormulation
-{
-    // indices of the primary variables
-    static const int pnIdx = PVOffset + 0; //!< index of the nonwetting phase pressure
-    static const int swIdx = PVOffset + 1; //!< index of the wetting phase saturation
+    static constexpr int conti0EqIdx = 0; //!< index of the first continuity equation
 };
 
-// \}
 } // namespace Dumux
 
 
diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh
index 65cfa0aceda67a9c163872cb3784c19650e09b28..1aacdb680e02b1c7f0269bbb7d5ca5e21d2d9426 100644
--- a/dumux/porousmediumflow/2p/model.hh
+++ b/dumux/porousmediumflow/2p/model.hh
@@ -71,6 +71,7 @@
 #include <dumux/porousmediumflow/nonisothermal/indices.hh>
 #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh>
 
+#include "formulation.hh"
 #include "indices.hh"
 #include "volumevariables.hh"
 #include "vtkoutputfields.hh"
@@ -81,8 +82,14 @@ namespace Dumux
  * \ingroup TwoPModel
  * \brief Specifies a number properties of two-phase models.
  */
+template<TwoPFormulation formulation>
 struct TwoPModelTraits
 {
+    using Indices = TwoPIndices;
+
+    static constexpr TwoPFormulation priVarFormulation()
+    { return formulation; }
+
     static constexpr int numEq() { return 2; }
     static constexpr int numPhases() { return 2; }
     static constexpr int numComponents() { return 2; }
@@ -92,6 +99,26 @@ struct TwoPModelTraits
     static constexpr bool enableEnergyBalance() { return false; }
 };
 
+/*!
+ * \ingroup TwoPModel
+ * \brief Traits class for the two-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct TwoPVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+};
+
 ////////////////////////////////
 // properties
 ////////////////////////////////
@@ -110,25 +137,32 @@ NEW_TYPE_TAG(TwoPNI, INHERITS_FROM(TwoP));
 ///////////////////////////////////////////////////////////////////////////
 // properties for the isothermal two-phase model
 ///////////////////////////////////////////////////////////////////////////
-SET_INT_PROP(TwoP, Formulation, TwoPFormulation::pwsn);                       //!< Set the default formulation to pWsN
+ //!< Set the default formulation to pwsn
+SET_PROP(TwoP, Formulation)
+{ static constexpr auto value = TwoPFormulation::p0s1; };
+
 SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>);         //!< Use the immiscible local residual operator for the 2p model
-SET_TYPE_PROP(TwoP, VolumeVariables, TwoPVolumeVariables<TypeTag>);           //!< the VolumeVariables property
 SET_TYPE_PROP(TwoP, SpatialParams, FVSpatialParams<TypeTag>);                 //!< The spatial parameters. Use FVSpatialParams by default.
 
 //! The model traits class
-SET_TYPE_PROP(TwoP, ModelTraits, TwoPModelTraits);
+SET_TYPE_PROP(TwoP, ModelTraits, TwoPModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>);
 
 //! Set the vtk output fields specific to the twop model
-SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>);
+SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields);
 
-//! The indices required by the isothermal 2p model
-SET_PROP(TwoP, Indices)
+//! Set the volume variables property
+SET_PROP(TwoP, VolumeVariables)
 {
 private:
-    using Fluidsystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    static constexpr int formulation = GET_PROP_VALUE(TypeTag, Formulation);
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = TwoPVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
 public:
-    using type = TwoPIndices<Fluidsystem, formulation, 0>;
+    using type = TwoPVolumeVariables<Traits>;
 };
 
 //! The two-phase model uses the immiscible fluid state
@@ -146,31 +180,18 @@ public:
 ////////////////////////////////////////////////////////
 
 //! The non-isothermal model traits class
-SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits<TwoPModelTraits>);
+SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits<TwoPModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>>);
 
 //! Set the vtk output fields specific to the non-isothermal twop model
-SET_TYPE_PROP(TwoPNI, VtkOutputFields, EnergyVtkOutputFields< TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)> >);
-
-//! Set non-isothermal Indices
-SET_PROP(TwoPNI, Indices)
-{
-private:
-    static constexpr int formulation = GET_PROP_VALUE(TypeTag, Formulation);
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalIndices = TwoPIndices<FluidSystem, formulation, 0>;
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
+SET_TYPE_PROP(TwoPNI, VtkOutputFields, EnergyVtkOutputFields<TwoPVtkOutputFields>);
 
 //! Somerton is used as default model to compute the effective thermal heat conductivity
 SET_PROP(TwoPNI, ThermalConductivityModel)
 {
 private:
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 public:
-    using type = ThermalConductivitySomerton<Scalar, Indices>;
+    using type = ThermalConductivitySomerton<Scalar>;
 };
 
 } // end namespace Properties
diff --git a/dumux/porousmediumflow/2p/sequential/celldata.hh b/dumux/porousmediumflow/2p/sequential/celldata.hh
index 55ca6bdaea610e190d126e0980324858de4dc27e..5248b71fab30aa65a4e714b15ddda53594cc7418 100644
--- a/dumux/porousmediumflow/2p/sequential/celldata.hh
+++ b/dumux/porousmediumflow/2p/sequential/celldata.hh
@@ -72,7 +72,7 @@ private:
         dim = GridView::dimension, dimWorld = GridView::dimensionworld
     };
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
@@ -406,7 +406,7 @@ private:
         dim = GridView::dimension, dimWorld = GridView::dimensionworld
     };
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/celldataadaptive.hh b/dumux/porousmediumflow/2p/sequential/celldataadaptive.hh
index c0011233b97fd435cddc593212995b97a8a7bd21..88693eac7becc99e4aaf50ada7ad80a80e3685a6 100644
--- a/dumux/porousmediumflow/2p/sequential/celldataadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/celldataadaptive.hh
@@ -50,7 +50,7 @@ private:
 
     using Element = typename GridView::Traits::template Codim<0>::Entity;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh
index 6bbabe7b2d4118232fff7b75d703b76164323bb8..c5bc6b52cbac44e4a4e4c9538baa57b4a9f05b1a 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh
@@ -124,7 +124,7 @@ template<class TypeTag> class FVPressure2P: public FVPressure<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureadaptive.hh
index 604b57aa9a04f7832ccd1436c017ed51f91c7c07..17c2be50c736d4ef91b5c76bc2c48ee2f5e7add3 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureadaptive.hh
@@ -51,7 +51,7 @@ template<class TypeTag> class FVPressure2PAdaptive: public FVPressure2P<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh
index 4632a94ca82970bcf3f98e00c6106668fcfbc3c1..0248b476ddf3c477401dc20f623890b2a1a28061 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh
@@ -66,7 +66,7 @@ class FVVelocity2P
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocityadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocityadaptive.hh
index ed142b982c443ba5933f5601e7ef7146ad00ddfa..105911ff8e4366371d5f86cb972ce5931f78aef7 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocityadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocityadaptive.hh
@@ -46,7 +46,7 @@ class FVVelocity2PAdaptive: public FVVelocity2P<TypeTag>
      using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
 
-     using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+     using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
      using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
      using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh
index eb1d9802bae4e165851b48e0acae0b159bd84dc7..b2de67970ba7bd4760fae86f421cd11420c4f100 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh
@@ -89,7 +89,7 @@ class CROperatorAssemblerTwoP
     using FaceMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, FaceLayout>;
 #endif
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum
     {
         pressureEqIdx = Indices::pressureEqIdx,
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperatoradaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperatoradaptive.hh
index da84089d9b7d4cebd6139ec545e31303328cb27a..959e8f261a66169d3120a528c855ef964b3fccb8 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperatoradaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperatoradaptive.hh
@@ -80,7 +80,7 @@ class CROperatorAssemblerTwoPAdaptive
     using SatType = Dune::BlockVector< Dune::FieldVector<double, 1> >;
     using IntersectionMapper = Dumux::IntersectionMapper<GridView>;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh
index f72e2b01cdcb25db6cfea659ff6e3515bbc79da2..b84ef09573c779f4cbab67eb7d00c850cbd1abbb 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh
@@ -55,7 +55,7 @@ class MimeticTwoPLocalStiffness: public LocalStiffness<TypeTag, 1>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     // grid types
     enum
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh
index 800a871227b72ccef6a9a5ed5c5fb958d924e35c..763c5c47875ceb72da4354c1c46c263ec40758ef 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh
@@ -56,7 +56,7 @@ class MimeticTwoPLocalStiffnessAdaptive: public LocalStiffness<TypeTag, 1>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     // grid types
     enum
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operator.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operator.hh
index f701531f53c49b065b54e8abb8ab3eb21cbabecc..bb44f18c991edb0607c4230fa0e8891d29bec789 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operator.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operator.hh
@@ -65,7 +65,7 @@ class MimeticOperatorAssemblerTwoP: public CROperatorAssemblerTwoP<TypeTag>
     using SolutionTypes = typename GET_PROP(TypeTag, SolutionTypes);
     using PrimaryVariables = typename SolutionTypes::PrimaryVariables;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operatoradaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operatoradaptive.hh
index 0c9be42c1a100160f20d69024ca6c851049935c7..4dd2db513a51fc6869c01372ccce70d2758fa9f7 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operatoradaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operatoradaptive.hh
@@ -66,7 +66,7 @@ class MimeticOperatorAssemblerTwoPAdaptive : public CROperatorAssemblerTwoPAdapt
     using SolutionTypes = typename GET_PROP(TypeTag, SolutionTypes);
     using PrimaryVariables = typename SolutionTypes::PrimaryVariables;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh
index c3ea9d82ed53739915c216c47b0cab0e17ff72d6..0b09d32acbfead84893c6ce0a14d867ce17c40d2 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh
@@ -70,7 +70,7 @@ template<class TypeTag> class MimeticPressure2P
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh
index 55dda8279bbd987d92a6e80b7109a51824884657..efde8796f4296a6a2d9b44b671f23a3ec106dc8f 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh
@@ -70,7 +70,7 @@ template<class TypeTag> class MimeticPressure2PAdaptive
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh
index e43496ffd1b6fe1a4ea67765e132a5baac45a562..0f6f2c520a950d96bf77f441f31b05b83b5a8aa6 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh
@@ -88,7 +88,7 @@ class FvMpfaL2dPressure2p: public FVPressure<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh
index 1ae14e113f1450928aa4d87572162a42d5c226ec..57be291cd3f7f15a652fcb9bf07d2e37d6d30fc5 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh
@@ -91,7 +91,7 @@ class FvMpfaL2dPressure2pAdaptive: public FVPressure<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh
index 7b5ce2693074babd1ed03fee39378a05d90e230d..fc70f09b3b9c83c0b5ec4b30e3ecc90a2d00fabc 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh
@@ -66,7 +66,7 @@ template<class TypeTag> class FvMpfaL2dPressureVelocity2p: public FvMpfaL2dPress
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh
index b9859bd3e127135990a014106697301b7d18c433..59b7279d8f8bb164831d917760af6df5cbe6554d 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh
@@ -68,7 +68,7 @@ template<class TypeTag> class FvMpfaL2dPressureVelocity2pAdaptive: public FvMpfa
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh
index 998e88be0b843f5f0576dbc51347c9ccb4e9c0b1..9fa7d84ba6df9d115a064220579c35c9d7d45d03 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh
@@ -71,7 +71,7 @@ template<class TypeTag> class FvMpfaL2dVelocity2p
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocityadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocityadaptive.hh
index 90ef25484fd15efeca490ac3b74b3d909a401e3a..77d80637b2b32f7c7b302a2198590649e35dfe67 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocityadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocityadaptive.hh
@@ -65,7 +65,7 @@ template<class TypeTag> class FvMpfaL2dVelocity2pAdaptive : public FvMpfaL2dVelo
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh
index f000f32fc066332ed9d30a1645f434539950675e..da0a4aed443dc2da8721e8348beb6ae08b173f1d 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh
@@ -58,7 +58,7 @@ class FvMpfaL3dInteractionVolumeContainer
 
     using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using SolutionTypes = typename GET_PROP(TypeTag, SolutionTypes);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh
index 8a07961c585b4317c13da64a048c5e7c8f80d4e6..90ae5aae56ddc7df9db4e03112f0b03fbd9af7ae 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh
@@ -61,7 +61,7 @@ class FvMpfaL3dInteractionVolumeContainerAdaptive: public FvMpfaL3dInteractionVo
 
     using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using Element = typename GridView::Traits::template Codim<0>::Entity;
     using Vertex = typename GridView::Traits::template Codim<dim>::Entity;
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh
index 7ae3e9514a95cc40b228ba6dbd7974446f7d97c5..6889ca62ea925f32f92c4053c79cdaff052b6ede 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh
@@ -87,7 +87,7 @@ class FvMpfaL3dPressure2p: public FVPressure<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureadaptive.hh
index 38ed04730eaa9923b7affa39b45b501e0ebfba2e..2b1c9a8e373a2d61ac0c0301c3b0b1d7b197f5d8 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureadaptive.hh
@@ -91,7 +91,7 @@ class FvMpfaL3dPressure2pAdaptive: public FvMpfaL3dPressure2p<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh
index f7b58f2dc8632699a56c461a7c5e4fc9f0f974e4..c04b54ca3c67f80f384975d3f8cac5765de18429 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh
@@ -54,7 +54,7 @@ template<class TypeTag> class FvMpfaL3dPressureVelocity2p: public FvMpfaL3dPress
             dim = GridView::dimension, dimWorld = GridView::dimensionworld
         };
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocityadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocityadaptive.hh
index 1a57242a9872e04c9f8a7aba8ed824ba2d2ee923..b15187cc587dca4295358f3b7110fdfd8b1579be 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocityadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocityadaptive.hh
@@ -54,7 +54,7 @@ template<class TypeTag> class FvMpfaL3dPressureVelocity2pAdaptive: public FvMpfa
         dim = GridView::dimension, dimWorld = GridView::dimensionworld
     };
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh
index 40b12f82048bb9e732bf861c14ac9b22b388290f..2073847f17dd12ca5ffa5730463ec78bcd1eb8e1 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh
@@ -67,7 +67,7 @@ template<class TypeTag> class FvMpfaL3dVelocity2p
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocityadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocityadaptive.hh
index 345bff361472adb916c5afdafeafaf3318426c50..32248040725ec055f924e44627ecbf3c6ec896db 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocityadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocityadaptive.hh
@@ -67,7 +67,7 @@ template<class TypeTag> class FvMpfaL3dVelocity2pAdaptive: public FvMpfaL3dVeloc
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh
index 6bba159b3acb0e8a45463ce2449c0675879024d4..f3c3b5a5661c83f286ad00ac53f77a6b3d026bd7 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh
@@ -84,7 +84,7 @@ class FvMpfaO2dPressure2p: public FVPressure<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh
index f8ac3bb18f61363e8998c99f6a6ddb41a865a075..99ac32de2d345736cf5eb1ac25b21e40bbbf4ead 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh
@@ -73,7 +73,7 @@ template<class TypeTag> class FvMpfaO2dPressureVelocity2p: public FvMpfaO2dPress
 
     using InteractionVolume = FVMPFAOInteractionVolume<TypeTag>;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum
         {
             wPhaseIdx = Indices::wPhaseIdx,
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh
index f36b890bee16e49bc4c69cc9538f53afddb6daf0..90b442f8f58e6469fa5d1b8c903a763c7cecd16b 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh
@@ -70,7 +70,7 @@ template<class TypeTag> class FvMpfaO2dVelocity2P
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/fluxdata.hh b/dumux/porousmediumflow/2p/sequential/fluxdata.hh
index 6068dceb1f66af4b0073f53926696ec4186d1d32..33af9b1a9f7e75f2f25a078026b8e9bc1d827010 100644
--- a/dumux/porousmediumflow/2p/sequential/fluxdata.hh
+++ b/dumux/porousmediumflow/2p/sequential/fluxdata.hh
@@ -48,7 +48,7 @@ private:
         dim = GridView::dimension
     };
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicator.hh b/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicator.hh
index 8e0ea932585dc825199a8c9b5778996c0895f79b..82f4b92e393f5174bd0b40811532dc656ecd5a53 100644
--- a/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicator.hh
+++ b/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicator.hh
@@ -49,7 +49,7 @@ private:
     using ScalarSolutionType = typename SolutionTypes::ScalarSolution;
     using ElementMapper = typename SolutionTypes::ElementMapper;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicatorlocal.hh b/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicatorlocal.hh
index 9148825c5ed6af26b7838d0dc9b95c42f1157ce5..d83699fd48a1b54e0a260e000e20e8dc30abbf5a 100644
--- a/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicatorlocal.hh
+++ b/dumux/porousmediumflow/2p/sequential/impes/gridadaptionindicatorlocal.hh
@@ -50,7 +50,7 @@ private:
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/capillarydiffusion.hh b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/capillarydiffusion.hh
index bade953df2cab7c659819d1f1f0ad012d67ba81a..e18c5eb9a8f12619d35f5263afd87362144e9f98 100644
--- a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/capillarydiffusion.hh
+++ b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/capillarydiffusion.hh
@@ -52,7 +52,7 @@ private:
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
       using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
       using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-      using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+      using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
       using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
       using MaterialLaw = typename SpatialParams::MaterialLaw;
diff --git a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxcoats.hh b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxcoats.hh
index 6837aafc28f033b3398768dd65c95466ee134818..a1739b1faa2113eec4d316984a13284a56008408 100644
--- a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxcoats.hh
+++ b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxcoats.hh
@@ -48,7 +48,7 @@ private:
     using MaterialLaw = typename SpatialParams::MaterialLaw;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using SolutionTypes = typename GET_PROP(TypeTag, SolutionTypes);
diff --git a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxdefault.hh b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxdefault.hh
index 58b59a522187d03efcf0e9dc9b3cca8c9afddcb1..8eae7c2e4ac5adc82519d08fffc6342eb5c20a09 100644
--- a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxdefault.hh
+++ b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxdefault.hh
@@ -45,7 +45,7 @@ private:
       using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
       using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-      using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+      using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/gravitypart.hh b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/gravitypart.hh
index ff6cb7d01505d438fce71999f331a94c1ab730a0..8dff9159d43744ebe760861067de7c423132d7f1 100644
--- a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/gravitypart.hh
+++ b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/gravitypart.hh
@@ -52,7 +52,7 @@ private:
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
diff --git a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh
index 17ff39242619982c41835643e633e6893c6f33aa..112d12684163dda445b77e21aa10dfc9ca76c32e 100644
--- a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh
+++ b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh
@@ -94,7 +94,7 @@ class FVSaturation2P: public FVTransport<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p/sequential/transport/problem.hh b/dumux/porousmediumflow/2p/sequential/transport/problem.hh
index ab9742dd564f9b6a6bfc074236d574c9f44fe125..2e0a751614784fdf0d86a187aafc7ac2da76d391 100644
--- a/dumux/porousmediumflow/2p/sequential/transport/problem.hh
+++ b/dumux/porousmediumflow/2p/sequential/transport/problem.hh
@@ -67,7 +67,7 @@ class TransportProblem2P : public OneModelProblem<TypeTag>
 
     using Element = typename GridView::Traits::template Codim<0>::Entity;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum {
         dim = Grid::dimension,
diff --git a/dumux/porousmediumflow/2p/volumevariables.hh b/dumux/porousmediumflow/2p/volumevariables.hh
index 65dfd78d45366ce3e79e55cf70cbeda1074e14b3..2675a44511882cf48f51703e0dfd3ca6cb60987c 100644
--- a/dumux/porousmediumflow/2p/volumevariables.hh
+++ b/dumux/porousmediumflow/2p/volumevariables.hh
@@ -25,9 +25,8 @@
 #ifndef DUMUX_2P_VOLUME_VARIABLES_HH
 #define DUMUX_2P_VOLUME_VARIABLES_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/volumevariables.hh>
-#include <dune/common/fvector.hh>
+#include "indices.hh"
 
 namespace Dumux {
 
@@ -36,40 +35,34 @@ namespace Dumux {
  * \brief Contains the quantities which are are constant within a
  *        finite volume in the two-phase model.
  */
-template <class TypeTag>
-class TwoPVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class TwoPVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, TwoPVolumeVariables<Traits> >
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, TwoPVolumeVariables<Traits> >;
+
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using ModelTraits = typename Traits::ModelTraits;
+    using Indices = typename ModelTraits::Indices;
+    static constexpr auto formulation = ModelTraits::priVarFormulation();
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using FS = typename Traits::FluidSystem;
 
     enum
     {
-        pwsn = Indices::pwsn,
-        pnsw = Indices::pnsw,
         pressureIdx = Indices::pressureIdx,
         saturationIdx = Indices::saturationIdx,
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-        numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
-        formulation = GET_PROP_VALUE(TypeTag, Formulation)
+
+        phase0Idx = FS::phase0Idx,
+        phase1Idx = FS::phase1Idx
     };
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
 
 public:
-    // export type of fluid state for non-isothermal models
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    //! export type of fluid system
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export type of fluid state
+    using FluidState = typename Traits::FluidState;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -80,18 +73,22 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub control volume
     */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
 
         completeFluidState(elemSol, problem, element, scv, fluidState_);
 
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
 
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        const int nPhaseIdx = 1 - wPhaseIdx;
+
         mobility_[wPhaseIdx] =
             MaterialLaw::krw(materialParams, fluidState_.saturation(wPhaseIdx))
             / fluidState_.viscosity(wPhaseIdx);
@@ -117,44 +114,50 @@ public:
      *
      * Set temperature, saturations, capillary pressures, viscosities, densities and enthalpies.
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
-                                   const Problem& problem,
-                                   const Element& element,
-                                   const SubControlVolume& scv,
-                                   FluidState& fluidState)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void completeFluidState(const ElemSol& elemSol,
+                            const Problem& problem,
+                            const Element& element,
+                            const Scv& scv,
+                            FluidState& fluidState)
     {
         Scalar t =  ParentType::temperature(elemSol, problem, element, scv);
         fluidState.setTemperature(t);
 
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
         const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
 
-        if (int(formulation) == pwsn) {
-            Scalar sn = priVars[saturationIdx];
-            fluidState.setSaturation(nPhaseIdx, sn);
-            fluidState.setSaturation(wPhaseIdx, 1 - sn);
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        if (formulation == TwoPFormulation::p0s1)
+        {
+            fluidState.setSaturation(phase1Idx, priVars[saturationIdx]);
+            fluidState.setSaturation(phase0Idx, 1 - priVars[saturationIdx]);
+        }
+        else if (formulation == TwoPFormulation::p1s0)
+        {
+            fluidState.setSaturation(phase0Idx, priVars[saturationIdx]);
+            fluidState.setSaturation(phase1Idx, 1 - priVars[saturationIdx]);
+        }
 
-            Scalar pw = priVars[pressureIdx];
-            fluidState.setPressure(wPhaseIdx, pw);
-            fluidState.setPressure(nPhaseIdx,
-                                   pw + MaterialLaw::pc(materialParams, 1 - sn));
+        pc_ = MaterialLaw::pc(materialParams, fluidState.saturation(wPhaseIdx));
+        if (formulation == TwoPFormulation::p0s1)
+        {
+            fluidState.setPressure(phase0Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase1Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] + pc_
+                                                                       : priVars[pressureIdx] - pc_);
         }
-        else if (int(formulation) == pnsw) {
-            Scalar sw = priVars[saturationIdx];
-            fluidState.setSaturation(wPhaseIdx, sw);
-            fluidState.setSaturation(nPhaseIdx, 1 - sw);
-
-            Scalar pn = priVars[pressureIdx];
-            fluidState.setPressure(nPhaseIdx, pn);
-            fluidState.setPressure(wPhaseIdx,
-                                   pn - MaterialLaw::pc(materialParams, sw));
+        else if (formulation == TwoPFormulation::p1s0)
+        {
+            fluidState.setPressure(phase1Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase0Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] - pc_
+                                                                       : priVars[pressureIdx] + pc_);
         }
 
         typename FluidSystem::ParameterCache paramCache;
         paramCache.updateAll(fluidState);
 
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
+        for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) {
             // compute and set the viscosity
             Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx);
             fluidState.setViscosity(phaseIdx, mu);
@@ -207,7 +210,7 @@ public:
      * in \f$[kg/(m*s^2)=N/m^2=Pa]\f$.
      */
     Scalar capillaryPressure() const
-    { return fluidState_.pressure(nPhaseIdx) - fluidState_.pressure(wPhaseIdx); }
+    { return pc_; }
 
     /*!
      * \brief Returns temperature inside the sub-control volume
@@ -251,20 +254,15 @@ public:
     { return permeability_; }
 
 protected:
-
     FluidState fluidState_;
-    Scalar porosity_;
-    PermeabilityType permeability_;
-    Scalar mobility_[numPhases];
 
 private:
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
-
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
+    Scalar pc_;
+    Scalar porosity_;
+    PermeabilityType permeability_;
+    Scalar mobility_[ModelTraits::numPhases()];
 };
 
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/2p/vtkoutputfields.hh b/dumux/porousmediumflow/2p/vtkoutputfields.hh
index 402c92cc6c5699594db861c7f536f1506107cc4f..fea024af3354a45691583e913bb70bdaece70b0c 100644
--- a/dumux/porousmediumflow/2p/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/2p/vtkoutputfields.hh
@@ -30,23 +30,27 @@ namespace Dumux {
  * \ingroup TwoPModel
  * \brief Adds vtk output fields specific to the two-phase model
  */
-template<class Indices>
 class TwoPVtkOutputFields
 {
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
-        vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc");
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "rhoW");
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::nPhaseIdx); }, "rhoN");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN");
-        vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FS = typename VolumeVariables::FluidSystem;
+
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.porosity(); }, "porosity");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.capillaryPressure(); }, "pc");
+
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FS::phase0Idx); }, "Sw");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FS::phase0Idx); }, "pw");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(FS::phase0Idx); }, "rhoW");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(FS::phase0Idx); }, "mobW");
+
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FS::phase1Idx); }, "Sn");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FS::phase1Idx); }, "pn");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(FS::phase1Idx); }, "rhoN");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(FS::phase1Idx); }, "mobN");
     }
 };
 
diff --git a/dumux/porousmediumflow/2p1c/darcyslaw.hh b/dumux/porousmediumflow/2p1c/darcyslaw.hh
index d872f635927d768fd055f8806135d056d93e3733..15ee9a6d56aef8d241cd8ca929d64e06e5f37a51 100644
--- a/dumux/porousmediumflow/2p1c/darcyslaw.hh
+++ b/dumux/porousmediumflow/2p1c/darcyslaw.hh
@@ -58,7 +58,8 @@ class TwoPOneCDarcysLaw : public DarcysLaw<TypeTag>
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using Element = typename GridView::template Codim<0>::Entity;
     using IndexType = typename GridView::IndexSet::IndexType;
     using CoordScalar = typename GridView::ctype;
@@ -69,8 +70,8 @@ class TwoPOneCDarcysLaw : public DarcysLaw<TypeTag>
     // copy some indices for convenience
     enum {
         // phase indices
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+        liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
+        gasPhaseIdx = FluidSystem::gasPhaseIdx,
     };
 
     using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
@@ -90,7 +91,7 @@ public:
         const Scalar flux = ParentType::flux(problem, element, fvGeometry, elemVolVars, scvf, phaseIdx, elemFluxVarCache);
 
         // only block wetting-phase (i.e. liquid water) fluxes
-        if((!GET_PROP_VALUE(TypeTag, UseBlockingOfSpuriousFlow)) || phaseIdx != wPhaseIdx)
+        if((!GET_PROP_VALUE(TypeTag, UseBlockingOfSpuriousFlow)) || phaseIdx != liquidPhaseIdx)
             return flux;
 
         const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
@@ -117,8 +118,8 @@ private:
         const Scalar tDn = dn.temperature(); //temperature of the downstream SCV (where the cold water is potentially intruding into a steam zone)
         const Scalar tUp = up.temperature(); //temperature of the upstream SCV
 
-        const Scalar sgDn = dn.saturation(nPhaseIdx); //gas phase saturation of the downstream SCV
-        const Scalar sgUp = up.saturation(nPhaseIdx); //gas phase saturation of the upstream SCV
+        const Scalar sgDn = dn.saturation(gasPhaseIdx); //gas phase saturation of the downstream SCV
+        const Scalar sgUp = up.saturation(gasPhaseIdx); //gas phase saturation of the upstream SCV
 
         bool upIsNotSteam = false;
         bool downIsSteam = false;
@@ -130,7 +131,7 @@ private:
         if(sgDn > 1e-5)
             downIsSteam = true;
 
-        if(upIsNotSteam && downIsSteam  && tDn > tUp && phaseIdx == wPhaseIdx)
+        if(upIsNotSteam && downIsSteam  && tDn > tUp && phaseIdx == liquidPhaseIdx)
           spuriousFlow = true;
 
         if(spuriousFlow)
diff --git a/dumux/porousmediumflow/2p1c/indices.hh b/dumux/porousmediumflow/2p1c/indices.hh
index 74f0ddd5cb1a25dabb0397c7c9aa85193871a5c9..15d5959f23e3422a484941ebb5b273e7b5e8840b 100644
--- a/dumux/porousmediumflow/2p1c/indices.hh
+++ b/dumux/porousmediumflow/2p1c/indices.hh
@@ -25,39 +25,29 @@
 #ifndef DUMUX_2P1C_INDICES_HH
 #define DUMUX_2P1C_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
 namespace Dumux {
 
 /*!
  * \ingroup TwoPOneCModel
  * \brief The indices for the two-phase one-component model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class FluidSystem, int PVOffset = 0>
 class TwoPOneCIndices
 {
 public:
-    // Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< Index of the wetting phase.
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< Index of the non-wetting phase.
-
     // Present phases (-> 'pseudo' primary variable)
-    static const int twoPhases = 1; //!< Both wetting and non-wetting phase are present.
-    static const int wPhaseOnly = 2; //!< Only the wetting phase is present.
-    static const int nPhaseOnly = 3; //!< Only non-wetting phase is present.
+    static const int twoPhases = 1; //!< Both liquid and gas phase are present.
+    static const int liquidPhaseOnly = 2; //!< Only the liquid phase is present.
+    static const int gasPhaseOnly = 3; //!< Only gas phase is present.
 
     // Primary variable indices
-    static const int pressureIdx = PVOffset + 0; //!< Index for phase pressure in a solution vector.
-    static const int switch1Idx = PVOffset + 1; //!< Index of saturation or temperature.
+    static const int pressureIdx = 0; //!< Index for phase pressure in a solution vector.
+    static const int switchIdx = 1; //!< Index of saturation or temperature.
 
     // Equation indices
-    static const int conti0EqIdx = PVOffset    + 0; //!< Index of the mass conservation equation for the water component.
-    static const int energyEqIdx = PVOffset + 1; //<! The index for energy in equation vectors.
+    static const int conti0EqIdx = 0; //!< Index of the mass conservation equation for the water component.
+    static const int energyEqIdx = 1; //<! The index for energy in equation vectors.
 };
 
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/2p1c/localresidual.hh b/dumux/porousmediumflow/2p1c/localresidual.hh
index e46738384b733e0d5198ea20f11208b92499c878..f7797145cc0ee5eb092c1be1f4b743c17fde8726 100644
--- a/dumux/porousmediumflow/2p1c/localresidual.hh
+++ b/dumux/porousmediumflow/2p1c/localresidual.hh
@@ -50,7 +50,7 @@ class TwoPOneCLocalResidual : public ImmiscibleLocalResidual<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     // first index for the mass balance
     enum { conti0EqIdx = Indices::conti0EqIdx };
 
diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh
index 5dcf328da753b4c1ecbec0d1e8c3595fe0b0e1d1..281a0a28e7312451995a8a8f760a2ec9eefbef66 100644
--- a/dumux/porousmediumflow/2p1c/model.hh
+++ b/dumux/porousmediumflow/2p1c/model.hh
@@ -77,8 +77,7 @@
 #include "volumevariables.hh"
 #include "primaryvariableswitch.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup TwoPOneCModel
@@ -87,6 +86,8 @@ namespace Dumux
  */
 struct TwoPOneCModelTraits
 {
+    using Indices = TwoPOneCIndices;
+
     static constexpr int numEq() { return 1; }
     static constexpr int numPhases() { return 2; }
     static constexpr int numComponents() { return 1; }
@@ -96,8 +97,27 @@ struct TwoPOneCModelTraits
     static constexpr bool enableEnergyBalance() { return false; }
 };
 
-namespace Properties
+/*!
+ * \ingroup TwoPOneCModel
+ * \brief Traits class for the two-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct TwoPOneCVolumeVariablesTraits
 {
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+};
+
+namespace Properties {
 //! The type tag for the non-isothermal two-phase one-component model.
 NEW_TYPE_TAG(TwoPOneCNI, INHERITS_FROM(PorousMediumFlow));
 
@@ -132,11 +152,23 @@ SET_TYPE_PROP(TwoPOneCNI, LocalResidual, TwoPOneCLocalResidual<TypeTag>);
 //! Use a modified version of Darcy's law which allows for blocking of spurious flows.
 SET_TYPE_PROP(TwoPOneCNI, AdvectionType, TwoPOneCDarcysLaw<TypeTag>);
 
-//! The specific volume variable (i.e. secondary variables).
-SET_TYPE_PROP(TwoPOneCNI, VolumeVariables, TwoPOneCVolumeVariables<TypeTag>);
+//! Set the volume variables property
+SET_PROP(TwoPOneCNI, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = TwoPOneCVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = TwoPOneCVolumeVariables<Traits>;
+};
 
 //! The primary variable switch for the 2p1cni model.
-SET_TYPE_PROP(TwoPOneCNI, PrimaryVariableSwitch, TwoPOneCPrimaryVariableSwitch<TypeTag>);
+SET_TYPE_PROP(TwoPOneCNI, PrimaryVariableSwitch, TwoPOneCPrimaryVariableSwitch);
 
 //! The primary variables vector for the 2p1cni model.
 SET_PROP(TwoPOneCNI, PrimaryVariables)
@@ -149,14 +181,7 @@ public:
 };
 
 //! Somerton is used as default model to compute the effective thermal heat conductivity.
-SET_PROP(TwoPOneCNI, ThermalConductivityModel)
-{
-private:
-     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-     using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-public:
-     using type = ThermalConductivitySomerton<Scalar>;
-};
+SET_TYPE_PROP(TwoPOneCNI, ThermalConductivityModel, ThermalConductivitySomerton<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
 //////////////////////////////////////////////////////////////////
 // Property values for isothermal model required for the general non-isothermal model
@@ -173,25 +198,8 @@ public:
     using type = PorousMediumFlowNIModelTraits<TwoPOneCModelTraits>;
 };
 
-//! Set non-isothermal Indices.
-SET_PROP(TwoPOneCNI, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalIndices = TwoPOneCIndices<FluidSystem, 0>;
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 //! The non-isothermal vtk output fields.
-SET_PROP(TwoPOneCNI, VtkOutputFields)
-{
-private:
-    using IsothermalFields = TwoPOneCVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
+SET_TYPE_PROP(TwoPOneCNI, VtkOutputFields, EnergyVtkOutputFields<TwoPOneCVtkOutputFields>);
 
 } // end namespace Properties
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh b/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh
index 3803bedc50e06d33bfdbd649d9c73f98e48a4b0d..04034051326c225dba40439307f620531c4131a3 100644
--- a/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh
@@ -24,7 +24,6 @@
 #ifndef DUMUX_2P1C_PRIMARY_VARIABLE_SWITCH_HH
 #define DUMUX_2P1C_PRIMARY_VARIABLE_SWITCH_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh>
 
 namespace Dumux {
@@ -33,35 +32,12 @@ namespace Dumux {
  * \ingroup TwoPOneCModel
  * \brief The primary variable switch for the two-phase one-component model
  */
-template<class TypeTag>
 class TwoPOneCPrimaryVariableSwitch
-: public PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPOneCPrimaryVariableSwitch<TypeTag>>
+: public PrimaryVariableSwitch<TwoPOneCPrimaryVariableSwitch>
 {
-    using ParentType = PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPOneCPrimaryVariableSwitch<TypeTag>>;
+    using ParentType = PrimaryVariableSwitch<TwoPOneCPrimaryVariableSwitch>;
     friend ParentType;
 
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum {
-        switchIdx = Indices::switch1Idx,
-
-        pressureIdx = Indices::pressureIdx,
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-
-        twoPhases = Indices::twoPhases,
-        wPhaseOnly  = Indices::wPhaseOnly,
-        nPhaseOnly  = Indices::nPhaseOnly
-    };
-
 public:
     using ParentType::ParentType;
 
@@ -75,48 +51,54 @@ protected:
      * \param dofIdxGlobal The respective dof index.
      * \param globalPos The global position of the dof.
      */
-    bool update_(PrimaryVariables& priVars,
+    template<class VolumeVariables, class GlobalPosition>
+    bool update_(typename VolumeVariables::PrimaryVariables& priVars,
                  const VolumeVariables& volVars,
-                 IndexType dofIdxGlobal,
+                 std::size_t dofIdxGlobal,
                  const GlobalPosition& globalPos)
     {
+        using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        using Indices = typename VolumeVariables::Indices;
+
+
         // evaluate primary variable switch
         bool wouldSwitch = false;
         int phasePresence =  priVars.state();
         int newPhasePresence = phasePresence;
 
         // check if a primary var switch is necessary
-        if (phasePresence == twoPhases)
+        if (phasePresence == Indices::twoPhases)
         {
             Scalar Smin = 0;
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(nPhaseIdx) <= Smin)
+            if (volVars.saturation(FluidSystem::gasPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // gas phase disappears
                 std::cout << "Gas phase disappears at vertex " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sg: "
-                          << volVars.saturation(nPhaseIdx) << std::endl;
-                newPhasePresence = wPhaseOnly;
+                          << volVars.saturation(FluidSystem::gasPhaseIdx) << std::endl;
+                newPhasePresence = Indices::liquidPhaseOnly;
 
-                priVars[switchIdx] = volVars.fluidState().temperature();
+                priVars[Indices::switchIdx] = volVars.fluidState().temperature();
             }
-            else if (volVars.saturation(wPhaseIdx) <= Smin)
+            else if (volVars.saturation(FluidSystem::liquidPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // water phase disappears
-                std::cout << "Wetting phase disappears at vertex " << dofIdxGlobal
+                std::cout << "Liquid phase disappears at vertex " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sw: "
-                          << volVars.saturation(wPhaseIdx) << std::endl;
-                newPhasePresence = nPhaseOnly;
+                          << volVars.saturation(FluidSystem::liquidPhaseIdx) << std::endl;
+                newPhasePresence = Indices::gasPhaseOnly;
 
-                priVars[switchIdx] = volVars.fluidState().temperature();
+                priVars[Indices::switchIdx] = volVars.fluidState().temperature();
             }
 
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == Indices::liquidPhaseOnly)
         {
             const Scalar temp = volVars.fluidState().temperature();
             const Scalar tempVap = volVars.vaporTemperature();
@@ -130,13 +112,13 @@ protected:
                 std::cout << "gas phase appears at vertex " << dofIdxGlobal
                           << ", coordinates: " << globalPos  << std::endl;
 
-               newPhasePresence = twoPhases;
-               priVars[switchIdx] = 0.9999; //wetting phase saturation
+               newPhasePresence = Indices::twoPhases;
+               priVars[Indices::switchIdx] = 0.9999; // liquid phase saturation
             }
         }
 
 
-        else if (phasePresence == nPhaseOnly)
+        else if (phasePresence == Indices::gasPhaseOnly)
         {
 
             const Scalar temp = volVars.fluidState().temperature();
@@ -145,13 +127,13 @@ protected:
             if (temp < tempVap)
             {
                 wouldSwitch = true;
-                // wetting phase appears
-                std::cout << "wetting phase appears at vertex " << dofIdxGlobal
+                // liquid phase appears
+                std::cout << "Liquid phase appears at vertex " << dofIdxGlobal
                           << ", coordinates: " << globalPos  << std::endl;
 
 
-               newPhasePresence = twoPhases;
-               priVars[switchIdx] = 0.0001; //arbitrary small value
+               newPhasePresence = Indices::twoPhases;
+               priVars[Indices::switchIdx] = 0.0001; //arbitrary small value
             }
     }
         priVars.setState(newPhasePresence);
diff --git a/dumux/porousmediumflow/2p1c/volumevariables.hh b/dumux/porousmediumflow/2p1c/volumevariables.hh
index f39e7c54690683a9e6e679ef1fb36fe32919d17c..13583f6b3fbd0fac2b802a164fddca72b6529391 100644
--- a/dumux/porousmediumflow/2p1c/volumevariables.hh
+++ b/dumux/porousmediumflow/2p1c/volumevariables.hh
@@ -25,8 +25,6 @@
 #define DUMUX_2P1C_VOLUME_VARIABLES_HH
 
 #include <dumux/porousmediumflow/volumevariables.hh>
-#include <dumux/material/fluidstates/compositional.hh>
-#include "indices.hh"
 
 namespace Dumux {
 
@@ -34,44 +32,41 @@ namespace Dumux {
  * \ingroup TwoPOneCModel
  * \brief The volume variables (i.e. secondary variables) for the two-phase one-component model.
  */
-template <class TypeTag>
-class TwoPOneCVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class TwoPOneCVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, TwoPOneCVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, TwoPOneCVolumeVariables<Traits>>;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using FS = typename Traits::FluidSystem;
+    using Idx = typename Traits::ModelTraits::Indices;
 
     enum {
-        numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-
-        switch1Idx = Indices::switch1Idx,
-        pressureIdx = Indices::pressureIdx
+        numPhases = Traits::ModelTraits::numPhases(),
+        switchIdx = Idx::switchIdx,
+        pressureIdx = Idx::pressureIdx
     };
 
     // present phases
     enum {
-        twoPhases = Indices::twoPhases,
-        wPhaseOnly  = Indices::wPhaseOnly,
-        nPhaseOnly  = Indices::nPhaseOnly,
+        twoPhases = Idx::twoPhases,
+        liquidPhaseOnly  = Idx::liquidPhaseOnly,
+        gasPhaseOnly  = Idx::gasPhaseOnly,
     };
 
-    using Element = typename GridView::template Codim<0>::Entity;
-
 public:
     //! The type of the object returned by the fluidState() method
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using FluidState = typename Traits::FluidState;
+    //! The type of the fluid system
+    using FluidSystem = typename Traits::FluidSystem;
+    //! The type of the indices
+    using Indices = typename Traits::ModelTraits::Indices;
+
+    // set liquid phase as wetting phase: TODO make this more flexible
+    static constexpr int wPhaseIdx = FluidSystem::liquidPhaseIdx;
+    // set gas phase as non-wetting phase: TODO make this more flexible
+    static constexpr int nPhaseIdx = FluidSystem::gasPhaseIdx;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -82,11 +77,11 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
 
@@ -95,6 +90,7 @@ public:
         /////////////
         // calculate the remaining quantities
         /////////////
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
 
         // Second instance of a parameter cache.
@@ -121,11 +117,11 @@ public:
     }
 
     //! Update the fluidstate
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static void completeFluidState(const ElemSol& elemSol,
                                    const Problem& problem,
                                    const Element& element,
-                                   const SubControlVolume& scv,
+                                   const Scv& scv,
                                    FluidState& fluidState)
     {
 
@@ -140,15 +136,15 @@ public:
         Scalar sg(0.0);
         if (phasePresence == twoPhases)
         {
-            sw = priVars[switch1Idx];
+            sw = priVars[switchIdx];
             sg = 1.0 - sw;
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == liquidPhaseOnly)
         {
             sw = 1.0;
             sg = 0.0;
         }
-        else if (phasePresence == nPhaseOnly)
+        else if (phasePresence == gasPhaseOnly)
         {
             sw = 0.0;
             sg = 1.0;
@@ -163,6 +159,7 @@ public:
         const Scalar pg = priVars[pressureIdx];
 
         // calculate capillary pressure
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const Scalar pc = MaterialLaw::pc(materialParams, sw);
 
         // set wetting phase pressure
@@ -174,8 +171,8 @@ public:
 
         // get temperature
         Scalar temperature;
-        if (phasePresence == wPhaseOnly || phasePresence == nPhaseOnly)
-            temperature = priVars[switch1Idx];
+        if (phasePresence == liquidPhaseOnly || phasePresence == gasPhaseOnly)
+            temperature = priVars[switchIdx];
         else if (phasePresence == twoPhases)
             temperature = FluidSystem::vaporTemperature(fluidState, wPhaseIdx);
         else
@@ -305,14 +302,8 @@ private:
     Scalar porosity_;               //!< Effective porosity within the control volume
     PermeabilityType permeability_; //!> Effective permeability within the control volume
     std::array<Scalar, numPhases> relativePermeability_;
-
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
-
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
 };
 
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh b/dumux/porousmediumflow/2p1c/vtkoutputfields.hh
index 054f68bf4ae0aaf1103bcccc75573a9293dda026..eb35ec319c9269259cc02be66514ad8532e7288b 100644
--- a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/2p1c/vtkoutputfields.hh
@@ -32,7 +32,6 @@ namespace Dumux {
  * \ingroup TwoPOneCModel
  * \brief Adds vtk output fields specific to two-phase one-component model.
  */
-template<class Indices>
 class TwoPOneCVtkOutputFields
 {
 public:
@@ -40,7 +39,7 @@ public:
     static void init(VtkOutputModule& vtk)
     {
         // use default fields from the 2p model
-        TwoPVtkOutputFields<Indices>::init(vtk);
+        TwoPVtkOutputFields::init(vtk);
 
         // output additional to TwoP output:
         vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phasePresence");
diff --git a/dumux/porousmediumflow/2p2c/indices.hh b/dumux/porousmediumflow/2p2c/indices.hh
index f494d8521b144d97b2bdd8c7cea130286b499532..ae353161751e532ec391b0be43c35f74fdb67278 100644
--- a/dumux/porousmediumflow/2p2c/indices.hh
+++ b/dumux/porousmediumflow/2p2c/indices.hh
@@ -24,53 +24,25 @@
 #ifndef DUMUX_2P2C_INDICES_HH
 #define DUMUX_2P2C_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
-/*!
- * \brief Enumerates the formulations which the two-phase two-component model accepts.
- * \ingroup TwoPTwoCModel
- */
-struct TwoPTwoCFormulation
-{ enum { pnsw, pwsn}; };
+namespace Dumux {
 
 /*!
  * \brief The indices for the isothermal two-phase two-component model.
  * \ingroup TwoPTwoCModel
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class FluidSystem, int PVOffset = 0>
 struct TwoPTwoCIndices
 {
-    // Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< index of the wetting phase
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< index of the non-wetting phase
-
-    // Component indices
-    static const int wCompIdx = FluidSystem::wCompIdx; //!< index of the primary component of the wetting phase
-    static const int nCompIdx = FluidSystem::nCompIdx; //!< index of the primary component of the non-wetting phase
-
     // present phases (-> 'pseudo' primary variable)
-    static const int wPhaseOnly = 1; //!< Only the non-wetting phase is present
-    static const int nPhaseOnly = 2; //!< Only the wetting phase is present
-    static const int bothPhases = 3; //!< Both phases are present
+    static constexpr int firstPhaseOnly = 1;  //!< Only the first phase (in fluid system) is present
+    static constexpr int secondPhaseOnly = 2; //!< Only the second phase (in fluid system) is present
+    static constexpr int bothPhases = 3;      //!< Both phases are present
 
     // Primary variable indices
-    //! index for wetting/non-wetting phase pressure (depending on the formulation) in a solution vector
-    static const int pressureIdx = PVOffset + 0;
-    //! index of either the saturation or the mass fraction of the non-wetting/wetting phase
-    static const int switchIdx = PVOffset + 1;
+    static constexpr int pressureIdx = 0; //! index for first/second phase pressure (depending on formulation) in privar vector
+    static constexpr int switchIdx = 1;   //! index of either the saturation or the mass/mole fraction of the first/second component
 
     // equation indices
-    //! index of the mass conservation equation for the first component
-    static const int conti0EqIdx = PVOffset;
-    //! index of the mass conservation equation for the primary component of the wetting phase
-    static const int contiWEqIdx = conti0EqIdx + wCompIdx;
-    //! index of the mass conservation equation for the primary component of the non-wetting phase
-    static const int contiNEqIdx = conti0EqIdx + nCompIdx;
+    static constexpr int conti0EqIdx = 0; //! index of the conservation equation for the first component
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh
index 879bdba7cafc5bc8e1b30c6c7c9f67222536416e..2bd9e7c2916c96f6356267229cc704b2ea837a97 100644
--- a/dumux/porousmediumflow/2p2c/model.hh
+++ b/dumux/porousmediumflow/2p2c/model.hh
@@ -82,6 +82,7 @@
 // property forward declarations
 #include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/properties.hh>
+#include <dumux/porousmediumflow/2p/formulation.hh>
 #include <dumux/porousmediumflow/nonisothermal/model.hh>
 #include <dumux/porousmediumflow/nonisothermal/indices.hh>
 #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh>
@@ -103,16 +104,50 @@ namespace Dumux {
 /*!
  * \ingroup TwoPTwoCModel
  * \brief Specifies a number properties of two-phase two-component models.
+ *
+ * \tparam f The two-phase formulation used
+ * \tparam useM Boolean to specify if moles or masses are balanced
  */
+template<TwoPFormulation f, bool useM>
 struct TwoPTwoCModelTraits
 {
+    using Indices = TwoPTwoCIndices;
+
     static constexpr int numEq() { return 2; }
     static constexpr int numPhases() { return 2; }
     static constexpr int numComponents() { return 2; }
 
+    static constexpr bool useMoles() { return useM; }
     static constexpr bool enableAdvection() { return true; }
     static constexpr bool enableMolecularDiffusion() { return true; }
     static constexpr bool enableEnergyBalance() { return false; }
+
+    static constexpr TwoPFormulation priVarFormulation() { return f; }
+};
+
+/*!
+ * \ingroup TwoPTwoCModel
+ * \brief Traits class for the two-phase two-component model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ * \tparam useKE boolean to indicate if kelvin equation is used for vapour pressure
+ * \tparam useCS boolean to indicate if a constraint solver is to be used
+ */
+template<class PV, class FSY, class FST, class PT, class MT, bool useKE, bool useCS>
+struct TwoPTwoCVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+
+    static constexpr bool useKelvinEquation = useKE;
+    static constexpr bool useConstraintSolver = useCS;
 };
 
 namespace Properties {
@@ -136,20 +171,14 @@ private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!");
     static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!");
+
 public:
-    using type = TwoPTwoCModelTraits;
+    using type = TwoPTwoCModelTraits< GET_PROP_VALUE(TypeTag, Formulation),
+                                      GET_PROP_VALUE(TypeTag, UseMoles) >;
 };
 
 //! Set the vtk output fields specific to this model
-SET_PROP(TwoPTwoC, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-public:
-    using type = TwoPTwoCVtkOutputFields<FluidSystem, Indices>;
-};
+SET_TYPE_PROP(TwoPTwoC, VtkOutputFields, TwoPTwoCVtkOutputFields);
 
 /*!
  * \brief The fluid state which is used by the volume variables to
@@ -167,7 +196,8 @@ public:
 };
 
 //! Set the default formulation to pw-sn
-SET_INT_PROP(TwoPTwoC, Formulation, TwoPTwoCFormulation::pwsn);
+SET_PROP(TwoPTwoC, Formulation)
+{ static constexpr TwoPFormulation value = TwoPFormulation::p0s1; };
 
 //! Set as default that no component mass balance is replaced by the total mass balance
 SET_INT_PROP(TwoPTwoC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents());
@@ -176,7 +206,7 @@ SET_INT_PROP(TwoPTwoC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, ModelTraits)::nu
 SET_TYPE_PROP(TwoPTwoC, LocalResidual, CompositionalLocalResidual<TypeTag>);
 
 //! The primary variable switch for the 2p2c model
-SET_TYPE_PROP(TwoPTwoC, PrimaryVariableSwitch, TwoPTwoCPrimaryVariableSwitch<TypeTag>);
+SET_TYPE_PROP(TwoPTwoC, PrimaryVariableSwitch, TwoPTwoCPrimaryVariableSwitch);
 
 //! The primary variables vector for the 2p2c model
 SET_PROP(TwoPTwoC, PrimaryVariables)
@@ -189,10 +219,22 @@ public:
 };
 
 //! Use the 2p2c VolumeVariables
-SET_TYPE_PROP(TwoPTwoC, VolumeVariables, TwoPTwoCVolumeVariables<TypeTag>);
+SET_PROP(TwoPTwoC, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    static constexpr bool useKE = GET_PROP_VALUE(TypeTag, UseKelvinEquation);
+    static constexpr bool useCS = GET_PROP_VALUE(TypeTag, UseConstraintSolver);
 
-//! Set the indices required by the isothermal 2p2c
-SET_TYPE_PROP(TwoPTwoC, Indices, TwoPTwoCIndices<typename GET_PROP_TYPE(TypeTag, FluidSystem), /*PVOffset=*/0>);
+    using Traits = TwoPTwoCVolumeVariablesTraits<PV, FSY, FST, PT, MT, useKE, useCS>;
+public:
+    using type = TwoPTwoCVolumeVariables<Traits>;
+};
 
 //! Use the FVSpatialParams by default
 SET_TYPE_PROP(TwoPTwoC, SpatialParams, FVSpatialParams<TypeTag>);
@@ -215,25 +257,14 @@ SET_PROP(TwoPTwoCNI, ThermalConductivityModel)
 {
 private:
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 public:
-    using type = ThermalConductivitySomerton<Scalar, Indices>;
+    using type = ThermalConductivitySomerton<Scalar>;
 };
 
 //////////////////////////////////////////////////////////////////
 // Property values for isothermal model required for the general non-isothermal model
 //////////////////////////////////////////////////////////////////
 
-//! Set non-isothermal Indices
-SET_PROP(TwoPTwoCNI, Indices)
-{
-private:
-    using IsothermalIndices = TwoPTwoCIndices<typename GET_PROP_TYPE(TypeTag, FluidSystem), /*PVOffset=*/0>;
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 //! Set the non-isothermal model traits
 SET_PROP(TwoPTwoCNI, ModelTraits)
 {
@@ -241,20 +272,14 @@ private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!");
     static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!");
+    using Traits = TwoPTwoCModelTraits< GET_PROP_VALUE(TypeTag, Formulation),
+                                        GET_PROP_VALUE(TypeTag, UseMoles) >;
 public:
-    using type = PorousMediumFlowNIModelTraits<TwoPTwoCModelTraits>;
+    using type = PorousMediumFlowNIModelTraits< Traits >;
 };
 
 //! Set non-isothermal output fields
-SET_PROP(TwoPTwoCNI, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-   using IsothermalFields = TwoPTwoCVtkOutputFields<FluidSystem, Indices>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
+SET_TYPE_PROP(TwoPTwoCNI, VtkOutputFields, EnergyVtkOutputFields<TwoPTwoCVtkOutputFields>);
 
 } // end namespace Properties
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/2p2c/primaryvariableswitch.hh b/dumux/porousmediumflow/2p2c/primaryvariableswitch.hh
index 703da6cb14871b652ab1f359cdeea665d17bb058..339d15a74fe3868f6eef70be2dd2d14532274d86 100644
--- a/dumux/porousmediumflow/2p2c/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/2p2c/primaryvariableswitch.hh
@@ -25,7 +25,7 @@
 #define DUMUX_2P2C_PRIMARY_VARIABLE_SWITCH_HH
 
 #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh>
-#include "indices.hh" // for TwoPTwoCFormulation
+#include <dumux/porousmediumflow/2p/formulation.hh>
 
 namespace Dumux
 {
@@ -33,63 +33,48 @@ namespace Dumux
  * \ingroup TwoPTwoCModel
  * \brief The primary variable switch controlling the phase presence state variable
  */
-template<class TypeTag>
-class TwoPTwoCPrimaryVariableSwitch
-: public PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPTwoCPrimaryVariableSwitch<TypeTag>>
+class TwoPTwoCPrimaryVariableSwitch : public PrimaryVariableSwitch<TwoPTwoCPrimaryVariableSwitch>
 {
-    using ParentType = PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPTwoCPrimaryVariableSwitch<TypeTag>>;
+    using ParentType = PrimaryVariableSwitch<TwoPTwoCPrimaryVariableSwitch>;
     friend ParentType;
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum {
-        switchIdx = Indices::switchIdx,
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
-
-        wPhaseOnly = Indices::wPhaseOnly,
-        nPhaseOnly = Indices::nPhaseOnly,
-        bothPhases = Indices::bothPhases,
-
-        pwsn = TwoPTwoCFormulation::pwsn,
-        pnsw = TwoPTwoCFormulation::pnsw,
-        formulation = GET_PROP_VALUE(TypeTag, Formulation)
-    };
-
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-
 public:
     using ParentType::ParentType;
 
 protected:
-
     // perform variable switch at a degree of freedom location
-    bool update_(PrimaryVariables& priVars,
+    template<class VolumeVariables, class IndexType, class GlobalPosition>
+    bool update_(typename VolumeVariables::PrimaryVariables& priVars,
                  const VolumeVariables& volVars,
                  IndexType dofIdxGlobal,
                  const GlobalPosition& globalPos)
     {
+        using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
+
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        static constexpr int phase0Idx = FluidSystem::phase0Idx;
+        static constexpr int phase1Idx = FluidSystem::phase1Idx;
+        static constexpr int comp0Idx = FluidSystem::comp0Idx;
+        static constexpr int comp1Idx = FluidSystem::comp1Idx;
+
+        static constexpr bool useMoles = VolumeVariables::useMoles();
+        static constexpr auto formulation = VolumeVariables::priVarFormulation();
+        static_assert( (formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0),
+                        "Chosen TwoPFormulation not supported!");
+
+        using Indices = typename VolumeVariables::Indices;
+        static constexpr int switchIdx = Indices::switchIdx;
+
         // evaluate primary variable switch
         bool wouldSwitch = false;
         int phasePresence = priVars.state();
         int newPhasePresence = phasePresence;
 
         // check if a primary var switch is necessary
-        if (phasePresence == nPhaseOnly)
+        if (phasePresence == Indices::secondPhaseOnly)
         {
-            // calculate mole fraction in the hypothetic wetting phase
-            Scalar xww = volVars.moleFraction(wPhaseIdx, wCompIdx);
-            Scalar xwn = volVars.moleFraction(wPhaseIdx, nCompIdx);
+            // calculate mole fraction in the hypothetic first phase
+            Scalar xww = volVars.moleFraction(phase0Idx, comp0Idx);
+            Scalar xwn = volVars.moleFraction(phase0Idx, comp1Idx);
 
             Scalar xwMax = 1.0;
             if (xww + xwn > xwMax)
@@ -98,26 +83,26 @@ protected:
                 xwMax *= 1.02;
 
             // if the sum of the mole fractions is larger than
-            // 100%, wetting phase appears
+            // 100%, first phase appears
             if (xww + xwn > xwMax)
             {
                 // wetting phase appears
-                std::cout << "wetting phase appears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", xww + xwn: "
+                std::cout << "first phase appears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", x00 + x01: "
                           << xww + xwn << std::endl;
-                newPhasePresence = bothPhases;
-                if (formulation == pnsw)
+                newPhasePresence = Indices::bothPhases;
+                if (formulation == TwoPFormulation::p1s0)
                     priVars[switchIdx] = 0.0001;
-                else if (formulation == pwsn)
+                else
                     priVars[switchIdx] = 0.9999;
             }
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == Indices::firstPhaseOnly)
         {
             // calculate fractions of the partial pressures in the
             // hypothetic nonwetting phase
-            Scalar xnw = volVars.moleFraction(nPhaseIdx, wCompIdx);
-            Scalar xnn = volVars.moleFraction(nPhaseIdx, nCompIdx);
+            Scalar xnw = volVars.moleFraction(phase1Idx, comp0Idx);
+            Scalar xnn = volVars.moleFraction(phase1Idx, comp1Idx);
 
             Scalar xgMax = 1.0;
             if (xnw + xnn > xgMax)
@@ -130,61 +115,49 @@ protected:
             if (xnw + xnn > xgMax)
             {
                 // nonwetting phase appears
-                std::cout << "nonwetting phase appears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", xnw + xnn: "
+                std::cout << "second phase appears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", x10 + x11: "
                           << xnw + xnn << std::endl;
-                newPhasePresence = bothPhases;
-                if (formulation == pnsw)
+                newPhasePresence = Indices::bothPhases;
+                if (formulation == TwoPFormulation::p1s0)
                     priVars[switchIdx] = 0.9999;
-                else if (formulation == pwsn)
+                else
                     priVars[switchIdx] = 0.0001;
             }
         }
-        else if (phasePresence == bothPhases)
+        else if (phasePresence == Indices::bothPhases)
         {
             Scalar Smin = 0.0;
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(nPhaseIdx) <= Smin)
+            if (volVars.saturation(phase1Idx) <= Smin)
             {
                 wouldSwitch = true;
                 // nonwetting phase disappears
-                std::cout << "Nonwetting phase disappears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", sn: "
-                          << volVars.saturation(nPhaseIdx) << std::endl;
-                newPhasePresence = wPhaseOnly;
+                std::cout << "second phase disappears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", s1: "
+                          << volVars.saturation(phase1Idx) << std::endl;
+                newPhasePresence = Indices::firstPhaseOnly;
 
                 if(useMoles) // mole-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.moleFraction(wPhaseIdx, nCompIdx);
-                }
+                    priVars[switchIdx] = volVars.moleFraction(phase0Idx, comp1Idx);
                 else // mass-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.massFraction(wPhaseIdx, nCompIdx);
-                }
+                    priVars[switchIdx] = volVars.massFraction(phase0Idx, comp1Idx);
             }
-            else if (volVars.saturation(wPhaseIdx) <= Smin)
+            else if (volVars.saturation(phase0Idx) <= Smin)
             {
                 wouldSwitch = true;
                 // wetting phase disappears
-                std::cout << "Wetting phase disappears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", sw: "
-                          << volVars.saturation(wPhaseIdx) << std::endl;
-                newPhasePresence = nPhaseOnly;
+                std::cout << "first phase disappears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", s0: "
+                          << volVars.saturation(phase0Idx) << std::endl;
+                newPhasePresence = Indices::secondPhaseOnly;
 
                 if(useMoles) // mole-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.moleFraction(nPhaseIdx, wCompIdx);
-                }
+                    priVars[switchIdx] = volVars.moleFraction(phase1Idx, comp0Idx);
                 else // mass-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.massFraction(nPhaseIdx, wCompIdx);
-                }
+                    priVars[switchIdx] = volVars.massFraction(phase1Idx, comp0Idx);
             }
         }
 
diff --git a/dumux/porousmediumflow/2p2c/sequential/celldata.hh b/dumux/porousmediumflow/2p2c/sequential/celldata.hh
index 8ef9ac6115a5108b8a795ba6e7e9802590301e4f..faa372fdd02c07383e651faaf4766a51a6450811 100644
--- a/dumux/porousmediumflow/2p2c/sequential/celldata.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/celldata.hh
@@ -48,7 +48,7 @@ private:
     using FluxData = FluxData2P2C<TypeTag>;
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p2c/sequential/celldataadaptive.hh b/dumux/porousmediumflow/2p2c/sequential/celldataadaptive.hh
index b437c7e2e417135741a9e95890c0e4265766c394..268ca8cfff16eb0e90f8b59cbf6c71ce12751eed 100644
--- a/dumux/porousmediumflow/2p2c/sequential/celldataadaptive.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/celldataadaptive.hh
@@ -55,7 +55,7 @@ private:
         dim = GridView::dimension
     };
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh b/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh
index 183ac7ec92965072b97cf07284e70e4b3c6e07c2..fdf0aeda605da1f5edae3d112fa985846d06aabb 100644
--- a/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh
@@ -50,7 +50,7 @@ private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using SimpleFluidState = PseudoOnePTwoCFluidState<Scalar, FluidSystem>;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p2c/sequential/fluxdata.hh b/dumux/porousmediumflow/2p2c/sequential/fluxdata.hh
index 95346641bddecf0bbf307bfb80531352fdf1d6ac..423c13308cbd00c7bdf899008bd43f0d19834868 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fluxdata.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fluxdata.hh
@@ -45,7 +45,7 @@ class FluxData2P2C
 private:
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/dumux/porousmediumflow/2p2c/sequential/fv2dpressureadaptive.hh b/dumux/porousmediumflow/2p2c/sequential/fv2dpressureadaptive.hh
index 43ce4d22c01c88c544504a530d062e2bce67ec97..bd4038eac3c5f5b70a99a4b90cbbe65251c4b754 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fv2dpressureadaptive.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fv2dpressureadaptive.hh
@@ -82,7 +82,7 @@ template<class TypeTag> class FV2dPressure2P2CAdaptive
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using CellData = typename GET_PROP_TYPE(TypeTag, CellData);
     enum
diff --git a/dumux/porousmediumflow/2p2c/sequential/fv2dtransportadaptive.hh b/dumux/porousmediumflow/2p2c/sequential/fv2dtransportadaptive.hh
index c41dac4b6d96afade159481b542f0683880f050c..6eecddef1eecc098d387c9d1164bc6bd8970d61a 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fv2dtransportadaptive.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fv2dtransportadaptive.hh
@@ -59,7 +59,7 @@ class FV2dTransport2P2CAdaptive : public FVTransport2P2C<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using CellData = typename GET_PROP_TYPE(TypeTag, CellData);
 
diff --git a/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh b/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh
index 2e3950b6307a9beeefe5fe20647acd95762b2e3b..dd116c55e756777a19e12c0f5129b00e21f4cb92 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh
@@ -91,7 +91,7 @@ template<class TypeTag> class FV3dPressure2P2CAdaptive
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
diff --git a/dumux/porousmediumflow/2p2c/sequential/fv3dtransportadaptive.hh b/dumux/porousmediumflow/2p2c/sequential/fv3dtransportadaptive.hh
index 261d5c4399466dabff745d9f7c12a07833ad070b..133004152017dda945785b3fd4d362c3b7e27590 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fv3dtransportadaptive.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fv3dtransportadaptive.hh
@@ -59,7 +59,7 @@ class FV3dTransport2P2CAdaptive : public FVTransport2P2C<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
diff --git a/dumux/porousmediumflow/2p2c/sequential/fvmpfal3dinteractionvolumecontaineradaptive.hh b/dumux/porousmediumflow/2p2c/sequential/fvmpfal3dinteractionvolumecontaineradaptive.hh
index 8e6b068b7ceb6604d65e6c4e0fd268af41951b94..252f5313134a59d4bfbf691d797a7c6c56b650a7 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fvmpfal3dinteractionvolumecontaineradaptive.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fvmpfal3dinteractionvolumecontaineradaptive.hh
@@ -56,7 +56,7 @@ class FvMpfaL3d2P2CInteractionVolumeContainerAdaptive : public FvMpfaL3dInteract
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP(TypeTag, SolutionTypes)::PrimaryVariables;
diff --git a/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh b/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh
index ee6cbf19d9293df8c5fe3ed51fa0559b676cc6e2..df84a9c1ba2053cc797bd97604ae692da441a58a 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh
@@ -81,7 +81,7 @@ template<class TypeTag> class FVPressure2P2C
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
diff --git a/dumux/porousmediumflow/2p2c/sequential/fvpressurecompositional.hh b/dumux/porousmediumflow/2p2c/sequential/fvpressurecompositional.hh
index 4285956569f626594966b810c55ee4c4b7adfe3f..62d7f625d132af68660c6e3e8a0c83e7ea8882de 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fvpressurecompositional.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fvpressurecompositional.hh
@@ -74,7 +74,7 @@ template<class TypeTag> class FVPressureCompositional
     using TransportSolutionType = typename GET_PROP_TYPE(TypeTag, TransportSolutionType);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh b/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh
index f788b480a80c84492b99a853c88ffd06e854c386..71c7e401e71edd69cba1add277ac68018aefc1f5 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh
@@ -76,7 +76,7 @@ class FVPressure2P2CMultiPhysics : public FVPressure2P2C<TypeTag>
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
diff --git a/dumux/porousmediumflow/2p2c/sequential/fvtransport.hh b/dumux/porousmediumflow/2p2c/sequential/fvtransport.hh
index a4bf38ae439b5650159b100cba9319854c845654..b7684bc7c6395ff810e8f79d0a6aed573c7469ce 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fvtransport.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fvtransport.hh
@@ -66,7 +66,7 @@ class FVTransport2P2C
     using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using MaterialLaw = typename SpatialParams::MaterialLaw;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
diff --git a/dumux/porousmediumflow/2p2c/sequential/fvtransportmultiphysics.hh b/dumux/porousmediumflow/2p2c/sequential/fvtransportmultiphysics.hh
index 115b8a65d6946e32bd2b7a1e1ce809a3b92edda1..4a2883eac85b5b16c8096c1722d0d5a7a9701546 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fvtransportmultiphysics.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fvtransportmultiphysics.hh
@@ -58,7 +58,7 @@ class FVTransport2P2CMultiPhysics : public FVTransport2P2C<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using CellData = typename GET_PROP_TYPE(TypeTag, CellData);
 
diff --git a/dumux/porousmediumflow/2p2c/sequential/problem.hh b/dumux/porousmediumflow/2p2c/sequential/problem.hh
index 8d102b66dbcd12598a7e65139d65760de19b8b72..8f28a836f6aea21af18dae4e33b9ae1e736dea03 100644
--- a/dumux/porousmediumflow/2p2c/sequential/problem.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/problem.hh
@@ -45,7 +45,7 @@ class IMPETProblem2P2C : public IMPESProblem2P<TypeTag>
     using ParentType = IMPESProblem2P<TypeTag>;
     using Implementation = typename GET_PROP_TYPE(TypeTag, Problem);
     using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Grid = typename GridView::Grid;
diff --git a/dumux/porousmediumflow/2p2c/sequential/properties.hh b/dumux/porousmediumflow/2p2c/sequential/properties.hh
index 4d05a5af1aa95af650bc329a0816e8c554f401b5..f6a2cb3c66a38a3c7bee0eeae5c4ce512ab7470b 100644
--- a/dumux/porousmediumflow/2p2c/sequential/properties.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/properties.hh
@@ -170,8 +170,8 @@ private:
 
 public:
     // Component indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx;
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx;
+    static const int wPhaseIdx = FluidSystem::phase0Idx;
+    static const int nPhaseIdx = FluidSystem::phase1Idx;
 
     // Component indices
     static const int wCompIdx = wPhaseIdx; //!< Component index equals phase index
diff --git a/dumux/porousmediumflow/2p2c/volumevariables.hh b/dumux/porousmediumflow/2p2c/volumevariables.hh
index 326078413c9215ae2a2f735211f829ea03e8bf4c..649b6fb68549865fb2fabd11010bac87580028aa 100644
--- a/dumux/porousmediumflow/2p2c/volumevariables.hh
+++ b/dumux/porousmediumflow/2p2c/volumevariables.hh
@@ -28,10 +28,10 @@
 #include <dumux/material/fluidstates/compositional.hh>
 #include <dumux/material/constraintsolvers/computefromreferencephase.hh>
 #include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh>
-#include <dumux/porousmediumflow/volumevariables.hh>
-#include <dumux/discretization/methods.hh>
 
-#include "indices.hh" // for formulation
+#include <dumux/discretization/methods.hh>
+#include <dumux/porousmediumflow/volumevariables.hh>
+#include <dumux/porousmediumflow/2p/formulation.hh>
 
 namespace Dumux {
 
@@ -40,75 +40,69 @@ namespace Dumux {
  * \brief Contains the quantities which are constant within a
  *        finite volume in the two-phase two-component model.
  */
-template <class TypeTag>
-class TwoPTwoCVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class TwoPTwoCVolumeVariables
+: public PorousMediumFlowVolumeVariables< Traits, TwoPTwoCVolumeVariables<Traits> >
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
+    using ParentType = PorousMediumFlowVolumeVariables< Traits, TwoPTwoCVolumeVariables<Traits> >;
 
-    // component indices
-    enum
-    {
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx
-    };
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using ModelTraits = typename Traits::ModelTraits;
 
-    // present phases
+    // component indices
     enum
     {
-        wPhaseOnly = Indices::wPhaseOnly,
-        nPhaseOnly = Indices::nPhaseOnly,
-        bothPhases = Indices::bothPhases
+        comp0Idx = Traits::FluidSystem::comp0Idx,
+        comp1Idx = Traits::FluidSystem::comp1Idx,
+        phase0Idx = Traits::FluidSystem::phase0Idx,
+        phase1Idx = Traits::FluidSystem::phase1Idx
     };
 
-    // formulations
+    // phase presence indices
     enum
     {
-        formulation = GET_PROP_VALUE(TypeTag, Formulation),
-        pwsn = TwoPTwoCFormulation::pwsn,
-        pnsw = TwoPTwoCFormulation::pnsw
+        firstPhaseOnly = ModelTraits::Indices::firstPhaseOnly,
+        secondPhaseOnly = ModelTraits::Indices::secondPhaseOnly,
+        bothPhases = ModelTraits::Indices::bothPhases
     };
 
     // primary variable indices
     enum
     {
-        switchIdx = Indices::switchIdx,
-        pressureIdx = Indices::pressureIdx
+        switchIdx = ModelTraits::Indices::switchIdx,
+        pressureIdx = ModelTraits::Indices::pressureIdx
     };
 
-    using Element = typename GridView::template Codim<0>::Entity;
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using ComputeFromReferencePhase = Dumux::ComputeFromReferencePhase<Scalar, FluidSystem>;
-
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-    static constexpr bool useKelvinEquation = GET_PROP_VALUE(TypeTag, UseKelvinEquation);
-    static constexpr bool useConstraintSolver = GET_PROP_VALUE(TypeTag, UseConstraintSolver);
-    static_assert(useMoles || (!useMoles && useConstraintSolver),
-                  "if UseMoles is set false, UseConstraintSolver has to be set to true");
+    // formulations
+    static constexpr auto formulation = ModelTraits::priVarFormulation();
 
-    using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FluidSystem, useKelvinEquation>;
+    // further specifications on the variables update
+    static constexpr bool useConstraintSolver = Traits::useConstraintSolver;
 
-    static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases();
-    static constexpr int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents();
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using ComputeFromReferencePhase = Dumux::ComputeFromReferencePhase<Scalar, typename Traits::FluidSystem>;
+    using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition< Scalar, typename Traits::FluidSystem >;
 public:
     //! The type of the object returned by the fluidState() method
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-
-    //! Pull member functions of the parent for deriving classes
-    using ParentType::temperature;
-    using ParentType::enthalpy;
+    using FluidState = typename Traits::FluidState;
+    //! The fluid system used here
+    using FluidSystem = typename Traits::FluidSystem;
+
+    //! return whether moles or masses are balanced
+    static constexpr bool useMoles() { return ModelTraits::useMoles(); }
+    //! return the two-phase formulation used here
+    static constexpr TwoPFormulation priVarFormulation() { return formulation; }
+
+    // check for permissive combinations
+    static_assert(useMoles() || (!useMoles() && useConstraintSolver), "if !UseMoles, UseConstraintSolver has to be set to true");
+    static_assert(ModelTraits::numPhases() == 2, "NumPhases set in the model is not two!");
+    static_assert(ModelTraits::numComponents() == 2, "NumComponents set in the model is not two!");
+    static_assert((formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!");
+
+    // The computations in the explicit composition update most probably assume a liquid-gas interface with
+    // liquid as first phase. TODO: is this really needed? The constraint solver does the job anyway, doesn't it?
+    static_assert(useConstraintSolver || (FluidSystem::isLiquid(phase0Idx) && !FluidSystem::isLiquid(phase1Idx)),
+                   "Explicit composition calculation has to be re-checked for NON-liquid-gas equilibria");
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -119,45 +113,30 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub control volume
     */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
-                const Problem &problem,
-                const Element &element,
-                const SubControlVolume& scv)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol& elemSol, const Problem& problem, const Element& element, const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
+        completeFluidState(elemSol, problem, element, scv, fluidState_);
 
-        Implementation::completeFluidState(elemSol, problem, element, scv, fluidState_);
-
-        /////////////
-        // calculate the remaining quantities
-        /////////////
-        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
-
-        // Second instance of a parameter cache.
-        // Could be avoided if diffusion coefficients also
-        // became part of the fluid state.
+        // Second instance of a parameter cache. Could be avoided if
+        // diffusion coefficients also became part of the fluid state.
         typename FluidSystem::ParameterCache paramCache;
         paramCache.updateAll(fluidState_);
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
-        {
-            // relative permeabilities
-            Scalar kr;
-            if (phaseIdx == wPhaseIdx)
-                kr = MaterialLaw::krw(materialParams, saturation(wPhaseIdx));
-            else // ATTENTION: krn requires the wetting phase saturation
-                // as parameter!
-                kr = MaterialLaw::krn(materialParams, saturation(wPhaseIdx));
-            relativePermeability_[phaseIdx] = kr;
-            Valgrind::CheckDefined(relativePermeability_[phaseIdx]);
-
-            // binary diffusion coefficients
-            diffCoeff_[phaseIdx] = FluidSystem::binaryDiffusionCoefficient(fluidState_,
-                                                                           paramCache,
-                                                                           phaseIdx,
-                                                                           wCompIdx,
-                                                                           nCompIdx);
-        }
+
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
+        const auto& matParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
+
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        const int nPhaseIdx = 1 - wPhaseIdx;
+
+        // relative permeabilities -> require wetting phase saturation as parameter!
+        relativePermeability_[wPhaseIdx] = MaterialLaw::krw(matParams, saturation(wPhaseIdx));
+        relativePermeability_[nPhaseIdx] = MaterialLaw::krn(matParams, saturation(wPhaseIdx));
+
+        // binary diffusion coefficients
+        diffCoeff_[phase0Idx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phase0Idx, comp0Idx, comp1Idx);
+        diffCoeff_[phase1Idx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phase1Idx, comp0Idx, comp1Idx);
 
         // porosity & permeabilty
         porosity_ = problem.spatialParams().porosity(element, scv, elemSol);
@@ -175,80 +154,76 @@ public:
      *
      * Set temperature, saturations, capillary pressures, viscosities, densities and enthalpies.
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
-                                   const Problem& problem,
-                                   const Element& element,
-                                   const SubControlVolume& scv,
-                                   FluidState& fluidState)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void completeFluidState(const ElemSol& elemSol,
+                            const Problem& problem,
+                            const Element& element,
+                            const Scv& scv,
+                            FluidState& fluidState)
     {
-        Scalar t = ParentType::temperature(elemSol, problem, element, scv);
+        const auto t = ParentType::temperature(elemSol, problem, element, scv);
         fluidState.setTemperature(t);
 
         const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
         const auto phasePresence = priVars.state();
 
-        /////////////
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
+        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        fluidState.setWettingPhase(wPhaseIdx);
+
         // set the saturations
-        /////////////
-        Scalar sn;
-        if (phasePresence == nPhaseOnly)
-            sn = 1.0;
-        else if (phasePresence == wPhaseOnly) {
-            sn = 0.0;
+        if (phasePresence == firstPhaseOnly)
+        {
+            fluidState.setSaturation(phase0Idx, 1.0);
+            fluidState.setSaturation(phase1Idx, 0.0);
         }
-        else if (phasePresence == bothPhases) {
-            if (formulation == pwsn)
-                sn = priVars[switchIdx];
-            else if (formulation == pnsw)
-                sn = 1.0 - priVars[switchIdx];
-            else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << formulation << " is invalid.");
+        else if (phasePresence == secondPhaseOnly)
+        {
+            fluidState.setSaturation(phase0Idx, 0.0);
+            fluidState.setSaturation(phase1Idx, 1.0);
         }
-        else DUNE_THROW(Dune::InvalidStateException, "phasePresence: " << phasePresence << " is invalid.");
-        fluidState.setSaturation(wPhaseIdx, 1 - sn);
-        fluidState.setSaturation(nPhaseIdx, sn);
-
-        /////////////
-        // set the pressures of the fluid phases
-        /////////////
-
-        // calculate capillary pressure
-        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
-        Scalar pc = MaterialLaw::pc(materialParams, 1 - sn);
+        else if (phasePresence == bothPhases)
+        {
+            if (formulation == TwoPFormulation::p0s1)
+            {
+                fluidState.setSaturation(phase1Idx, priVars[switchIdx]);
+                fluidState.setSaturation(phase0Idx, 1 - priVars[switchIdx]);
+            }
+            else
+            {
+                fluidState.setSaturation(phase0Idx, priVars[switchIdx]);
+                fluidState.setSaturation(phase1Idx, 1 - priVars[switchIdx]);
+            }
+        }
+        else
+            DUNE_THROW(Dune::InvalidStateException, "Invalid phase presence.");
 
-        if (formulation == pwsn) {
-            fluidState.setPressure(wPhaseIdx, priVars[pressureIdx]);
-            fluidState.setPressure(nPhaseIdx, priVars[pressureIdx] + pc);
+        // set pressures of the fluid phases
+        pc_ = MaterialLaw::pc(materialParams, fluidState.saturation(wPhaseIdx));
+        if (formulation == TwoPFormulation::p0s1)
+        {
+            fluidState.setPressure(phase0Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase1Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] + pc_
+                                                                       : priVars[pressureIdx] - pc_);
         }
-        else if (formulation == pnsw) {
-            fluidState.setPressure(nPhaseIdx, priVars[pressureIdx]);
-            fluidState.setPressure(wPhaseIdx, priVars[pressureIdx] - pc);
+        else
+        {
+            fluidState.setPressure(phase1Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase0Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] - pc_
+                                                                       : priVars[pressureIdx] + pc_);
         }
-        else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << formulation << " is invalid.");
 
-        /////////////
         // calculate the phase compositions
-        /////////////
         typename FluidSystem::ParameterCache paramCache;
 
-        //get the phase pressures and set the fugacity coefficients here if constraintsolver is not used
-        Scalar pn = 0;
-        Scalar pw = 0;
-
-        if(!useConstraintSolver) {
-            if (formulation == pwsn) {
-                pw = priVars[pressureIdx];
-                pn = pw + pc;
-            }
-            else {
-                pn = priVars[pressureIdx];
-                pw = pn - pc;
-            }
-
-            for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
+        // If constraint solver is not used, get the phase pressures and set the fugacity coefficients here
+        if(!useConstraintSolver)
+        {
+            for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++ phaseIdx)
+            {
                 assert(FluidSystem::isIdealMixture(phaseIdx));
-
-                for (int compIdx = 0; compIdx < numComponents; ++ compIdx) {
+                for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++ compIdx) {
                     Scalar phi = FluidSystem::fugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx);
                     fluidState.setFugacityCoefficient(phaseIdx, compIdx, phi);
                 }
@@ -256,163 +231,143 @@ public:
         }
 
         // now comes the tricky part: calculate phase compositions
-        if (phasePresence == bothPhases) {
-            // both phases are present, phase compositions are a
-            // result of the nonwetting <-> wetting equilibrium. This is
-            // the job of the "MiscibleMultiPhaseComposition"
-            // constraint solver
-            if(useConstraintSolver) {
+        const Scalar p0 = fluidState.pressure(phase0Idx);
+        const Scalar p1 = fluidState.pressure(phase1Idx);
+        if (phasePresence == bothPhases)
+        {
+            // both phases are present, phase compositions are a result
+            // of the equilibrium between the phases. This is the job
+            // of the "MiscibleMultiPhaseComposition" constraint solver
+            if(useConstraintSolver)
                 MiscibleMultiPhaseComposition::solve(fluidState,
                                                      paramCache,
                                                      /*setViscosity=*/true,
                                                      /*setEnthalpy=*/false);
-            }
             // ... or calculated explicitly this way ...
-            else {
-                //get the partial pressure of the main component of the the wetting phase ("H20") within the nonwetting (gas) phase == vapor pressure due to equilibrium
-                //note that in this case the fugacityCoefficient * pw is the vapor pressure (see implementation in respective fluidsystem)
-                Scalar partPressH2O = FluidSystem::fugacityCoefficient(fluidState,
-                                                                       wPhaseIdx,
-                                                                       wCompIdx) * pw;
-
-                if (useKelvinEquation)
-                    partPressH2O = FluidSystem::kelvinVaporPressure(fluidState, wPhaseIdx, wCompIdx);
+            else
+            {
+                // get the partial pressure of the main component of the first phase within the
+                // second phase == vapor pressure due to equilibrium. Note that in this case the
+                // fugacityCoefficient * p is the vapor pressure (see implementation in respective fluidsystem)
+                const Scalar partPressLiquid = FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx)*p0;
 
-                // get the partial pressure of the main component of the the nonwetting (gas) phase ("Air")
-                Scalar partPressAir = pn - partPressH2O;
+                // get the partial pressure of the main component of the gas phase
+                const Scalar partPressGas = p1 - partPressLiquid;
 
-                //calculate the mole fractions of the components within the nonwetting phase
-                Scalar xnn = partPressAir/pn;
-                Scalar xnw = partPressH2O/pn;
+                // calculate the mole fractions of the components within the nonwetting phase
+                const Scalar xnn = partPressGas / p1;
+                const Scalar xnw = partPressLiquid / p1;
 
                 // calculate the mole fractions of the components within the wetting phase
-                //note that in this case the fugacityCoefficient * pw is the Henry Coefficient (see implementation in respective fluidsystem)
-                Scalar xwn = partPressAir
-                  / (FluidSystem::fugacityCoefficient(fluidState,
-                                                      wPhaseIdx,nCompIdx)
-                  * pw);
-
-                Scalar xww = 1.0 -xwn;
-
-                //set all mole fractions
-                fluidState.setMoleFraction(wPhaseIdx, wCompIdx, xww);
-                fluidState.setMoleFraction(wPhaseIdx, nCompIdx, xwn);
-                fluidState.setMoleFraction(nPhaseIdx, wCompIdx, xnw);
-                fluidState.setMoleFraction(nPhaseIdx, nCompIdx, xnn);
+                // note that in this case the fugacityCoefficient * p is the Henry Coefficient
+                // (see implementation in respective fluidsystem)
+                const Scalar xwn = partPressGas / (FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx)*p0);
+                const Scalar xww = 1.0 - xwn;
+
+                // set all mole fractions
+                fluidState.setMoleFraction(phase0Idx, comp0Idx, xww);
+                fluidState.setMoleFraction(phase0Idx, comp1Idx, xwn);
+                fluidState.setMoleFraction(phase1Idx, comp0Idx, xnw);
+                fluidState.setMoleFraction(phase1Idx, comp1Idx, xnn);
             }
         }
-        else if (phasePresence == nPhaseOnly)
+        else if (phasePresence == secondPhaseOnly)
         {
-            // only the nonwetting phase is present, i.e. nonwetting phase
-            // composition is stored explicitly.
-            if(useMoles)
+            // only the second phase is present, composition is stored explicitly.
+            if( useMoles() )
             {
-                fluidState.setMoleFraction(nPhaseIdx, nCompIdx, 1 - priVars[switchIdx]);
-                fluidState.setMoleFraction(nPhaseIdx, wCompIdx, priVars[switchIdx]);
+                fluidState.setMoleFraction(phase1Idx, comp1Idx, 1 - priVars[switchIdx]);
+                fluidState.setMoleFraction(phase1Idx, comp0Idx, priVars[switchIdx]);
             }
+            // setMassFraction() has only to be called 1-numComponents times
             else
-            {
-                // setMassFraction() has only to be called 1-numComponents times
-                fluidState.setMassFraction(nPhaseIdx, wCompIdx, priVars[switchIdx]);
-            }
+                fluidState.setMassFraction(phase1Idx, comp0Idx, priVars[switchIdx]);
 
             // calculate the composition of the remaining phases (as
             // well as the densities of all phases). This is the job
             // of the "ComputeFromReferencePhase" constraint solver
-            if (useConstraintSolver) {
+            if (useConstraintSolver)
                 ComputeFromReferencePhase::solve(fluidState,
                                                  paramCache,
-                                                 nPhaseIdx,
+                                                 phase1Idx,
                                                  /*setViscosity=*/true,
                                                  /*setEnthalpy=*/false);
-            }
             // ... or calculated explicitly this way ...
-            else {
+            else
+            {
                 // note that the water phase is actually not existing!
                 // thus, this is used as phase switch criterion
-                Scalar xnw = priVars[switchIdx];
-                Scalar xnn = 1.0 -xnw;
+                const Scalar xnw = priVars[switchIdx];
+                const Scalar xnn = 1.0 - xnw;
 
-                //first, xww:
+                // first, xww:
                 // xnw * pn = "actual" (hypothetical) vapor pressure
                 // fugacityCoefficient * pw = vapor pressure given by thermodynamic conditions
                 // Here, xww is not actually the mole fraction of water in the wetting phase
                 // xww is only the ratio of "actual" vapor pressure / "thermodynamic" vapor pressure
                 // If xww > 1 : gas is over-saturated with water vapor,
                 // condensation takes place (see switch criterion in model)
-                Scalar xww = xnw * pn
-                  / (FluidSystem::fugacityCoefficient(fluidState,
-                                                      wPhaseIdx,wCompIdx)
-                     * pw);
-
-                // now, xwn:
-                //partialPressure / xwn = Henry
-                //partialPressure = xnn * pn
-                //xwn = xnn * pn / Henry
+                const Scalar xww = xnw*p1/( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx)*p0 );
+
+                // second, xwn:
+                // partialPressure / xwn = Henry
+                // partialPressure = xnn * pn
+                // xwn = xnn * pn / Henry
                 // Henry = fugacityCoefficient * pw
-                Scalar xwn = xnn * pn / (FluidSystem::fugacityCoefficient(fluidState,
-                                                                          wPhaseIdx,nCompIdx)
-                                         * pw);
+                const Scalar xwn = xnn*p1/( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx)*p0 );
 
-                fluidState.setMoleFraction(wPhaseIdx, wCompIdx, xww);
-                fluidState.setMoleFraction(wPhaseIdx, nCompIdx, xwn);
+                fluidState.setMoleFraction(phase0Idx, comp0Idx, xww);
+                fluidState.setMoleFraction(phase0Idx, comp1Idx, xwn);
             }
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == firstPhaseOnly)
         {
             // only the wetting phase is present, i.e. wetting phase
             // composition is stored explicitly.
-            if(useMoles) // mole-fraction formulation
+            if( useMoles() ) // mole-fraction formulation
             {
-                fluidState.setMoleFraction(wPhaseIdx, wCompIdx, 1-priVars[switchIdx]);
-                fluidState.setMoleFraction(wPhaseIdx, nCompIdx, priVars[switchIdx]);
+                fluidState.setMoleFraction(phase0Idx, comp0Idx, 1-priVars[switchIdx]);
+                fluidState.setMoleFraction(phase0Idx, comp1Idx, priVars[switchIdx]);
             }
+            // setMassFraction() has only to be called 1-numComponents times
             else // mass-fraction formulation
-            {
-                // setMassFraction() has only to be called 1-numComponents times
-                fluidState.setMassFraction(wPhaseIdx, nCompIdx, priVars[switchIdx]);
-            }
+                fluidState.setMassFraction(phase0Idx, comp1Idx, priVars[switchIdx]);
 
             // calculate the composition of the remaining phases (as
             // well as the densities of all phases). This is the job
             // of the "ComputeFromReferencePhase" constraint solver
-            if (useConstraintSolver) {
+            if (useConstraintSolver)
                 ComputeFromReferencePhase::solve(fluidState,
                                                  paramCache,
-                                                 wPhaseIdx,
+                                                 phase0Idx,
                                                  /*setViscosity=*/true,
                                                  /*setEnthalpy=*/false);
-            }
             // ... or calculated explicitly this way ...
             else
             {
                 // note that the gas phase is actually not existing!
                 // thus, this is used as phase switch criterion
-                Scalar xwn = priVars[switchIdx];
+                const Scalar xwn = priVars[switchIdx];
 
-                //first, xnw:
-                //psteam = xnw * pn = partial pressure of water in gas phase
-                //psteam = fugacityCoefficient * pw
-                Scalar xnw = (FluidSystem::fugacityCoefficient(fluidState,
-                                                               wPhaseIdx,wCompIdx)
-                              * pw) / pn ;
+                // first, xnw:
+                // psteam = xnw * pn = partial pressure of water in gas phase
+                // psteam = fugacityCoefficient * pw
+                const Scalar xnw = ( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx)*p0 )/p1;
 
-                //now, xnn:
+                // second, xnn:
                 // xwn = partialPressure / Henry
                 // partialPressure = pn * xnn
                 // xwn = pn * xnn / Henry
                 // xnn = xwn * Henry / pn
                 // Henry = fugacityCoefficient * pw
-                Scalar xnn = xwn * (FluidSystem::fugacityCoefficient(fluidState,
-                                                                     wPhaseIdx,nCompIdx)
-                                    * pw) / pn ;
+                const Scalar xnn = xwn*( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx)*p0 )/p1;
 
-                fluidState.setMoleFraction(nPhaseIdx, nCompIdx, xnn);
-                fluidState.setMoleFraction(nPhaseIdx, wCompIdx, xnw);
+                fluidState.setMoleFraction(phase1Idx, comp1Idx, xnn);
+                fluidState.setMoleFraction(phase1Idx, comp0Idx, xnw);
             }
         }
 
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+        for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx)
         {
             // set the viscosity and desity here if constraintsolver is not used
             if(!useConstraintSolver)
@@ -423,13 +378,13 @@ public:
                 const Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx);
                 fluidState.setViscosity(phaseIdx,mu);
             }
+
             // compute and set the enthalpy
             Scalar h = ParentType::enthalpy(fluidState, paramCache, phaseIdx);
             fluidState.setEnthalpy(phaseIdx, h);
         }
    }
 
-
     /*!
      * \brief Returns the phase state within the control volume.
      */
@@ -518,9 +473,7 @@ public:
      * \param phaseIdx The phase index
      */
     Scalar relativePermeability(const int phaseIdx) const
-    {
-        return relativePermeability_[phaseIdx];
-    }
+    { return relativePermeability_[phaseIdx]; }
 
     /*!
      * \brief Returns the effective mobility of a given phase within
@@ -529,16 +482,14 @@ public:
      * \param phaseIdx The phase index
      */
     Scalar mobility(const int phaseIdx) const
-    {
-        return relativePermeability_[phaseIdx]/fluidState_.viscosity(phaseIdx);
-    }
+    { return relativePermeability_[phaseIdx]/fluidState_.viscosity(phaseIdx); }
 
     /*!
      * \brief Returns the effective capillary pressure within the control volume
      *        in \f$[kg/(m*s^2)=N/m^2=Pa]\f$.
      */
     Scalar capillaryPressure() const
-    { return fluidState_.pressure(nPhaseIdx) - fluidState_.pressure(wPhaseIdx); }
+    { return pc_; }
 
     /*!
      * \brief Returns the average porosity within the control volume in \f$[-]\f$.
@@ -563,21 +514,17 @@ public:
             return diffCoeff_[phaseIdx];
     }
 
-
-protected:
-
-    Scalar porosity_; //!< Effective porosity within the control volume
-    PermeabilityType permeability_; //!< Effective permeability within the control volume
-    Scalar relativePermeability_[numPhases]; //!< Relative permeability within the control volume
-    Scalar diffCoeff_[numPhases]; //!< Binary diffusion coefficients for the phases
+private:
     FluidState fluidState_;
+    Scalar pc_;                     //!< The capillary pressure
+    Scalar porosity_;               //!< Effective porosity within the control volume
+    PermeabilityType permeability_; //!< Effective permeability within the control volume
 
-private:
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
+    //!< Relative permeability within the control volume
+    std::array<Scalar, ModelTraits::numPhases()> relativePermeability_;
 
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
+    //!< Binary diffusion coefficients for the phases
+    std::array<Scalar, ModelTraits::numPhases()> diffCoeff_;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/2p2c/vtkoutputfields.hh b/dumux/porousmediumflow/2p2c/vtkoutputfields.hh
index 75e9dc0699ad955f0bbca5e576f878181cd1dde6..c947f2a3f968d05d10d4b7ef9f7c7cd2d959e9d3 100644
--- a/dumux/porousmediumflow/2p2c/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/2p2c/vtkoutputfields.hh
@@ -24,40 +24,38 @@
 #ifndef DUMUX_TWOPTWOC_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_TWOPTWOC_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup TwoPTwoCModel
  * \brief Adds vtk output fields specific to the two-phase two-component model
  */
-template<class FluidSystem, class Indices>
 class TwoPTwoCVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
         // register standardized vtk output fields
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase1Idx); }, "Sn");
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase0Idx); }, "Sw");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase1Idx); }, "pn");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase0Idx); }, "pw");
         vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc");
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "rhoW");
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::nPhaseIdx); }, "rhoN");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN");
+        vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase0Idx); }, "rhoW");
+        vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase1Idx); }, "rhoN");
+        vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase0Idx); }, "mobW");
+        vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase1Idx); }, "mobN");
 
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
                 vtk.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); },"X_"+ FluidSystem::phaseName(i) + "^" + FluidSystem::componentName(j));
 
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
                 vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x_"+ FluidSystem::phaseName(i) + "^" + FluidSystem::componentName(j));
 
         vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
diff --git a/dumux/porousmediumflow/2pnc/CMakeLists.txt b/dumux/porousmediumflow/2pnc/CMakeLists.txt
index 5e3c930c89509e68756c958178cff2e748398917..81352b781a2ad3666225b9df58ad757b10e5e3a1 100644
--- a/dumux/porousmediumflow/2pnc/CMakeLists.txt
+++ b/dumux/porousmediumflow/2pnc/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 #install headers
 install(FILES
-indices.hh
 model.hh
 primaryvariableswitch.hh
 volumevariables.hh
diff --git a/dumux/porousmediumflow/2pnc/indices.hh b/dumux/porousmediumflow/2pnc/indices.hh
deleted file mode 100644
index a6b6d239547c6421e5e53e240b9bb15bebf147a3..0000000000000000000000000000000000000000
--- a/dumux/porousmediumflow/2pnc/indices.hh
+++ /dev/null
@@ -1,82 +0,0 @@
-// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-// vi: set et ts=4 sw=4 sts=4:
-/*****************************************************************************
- *   See the file COPYING for full copying permissions.                      *
- *                                                                           *
- *   This program is free software: you can redistribute it and/or modify    *
- *   it under the terms of the GNU General Public License as published by    *
- *   the Free Software Foundation, either version 2 of the License, or       *
- *   (at your option) any later version.                                     *
- *                                                                           *
- *   This program is distributed in the hope that it will be useful,         *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
- *   GNU General Public License for more details.                            *
- *                                                                           *
- *   You should have received a copy of the GNU General Public License       *
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
- *****************************************************************************/
-/*!
- * \file
- * \ingroup TwoPNCModel
- * \brief Defines the indices required for the two-phase n-component
- *        fully implicit model.
- */
-#ifndef DUMUX_2PNC_INDICES_HH
-#define DUMUX_2PNC_INDICES_HH
-
-#include <dumux/common/properties.hh>
-
-namespace Dumux {
-
-/*!
- * \ingroup TwoPNCModel
- * \brief Enumerates the formulations which the two-phase n-component model accepts.
- */
-struct TwoPNCFormulation
-{
-    enum {
-        pnsw,
-        pwsn
-        };
-};
-
-/*!
- * \ingroup TwoPNCModel
- * \brief The indices for the isothermal two-phase n-component model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
- */
-template <class FluidSystem, int PVOffset = 0>
-class TwoPNCIndices
-{
-public:
-    // Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx;    //!< index of the wetting phase
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx;    //!< index of the non-wetting phase
-
-    // Component indices
-    static const int wCompIdx = FluidSystem::wCompIdx;      //!< index of the primary component of the wetting phase
-    static const int nCompIdx = FluidSystem::nCompIdx;      //!< index of the primary component of the non-wetting phase
-
-    // present phases (-> 'pseudo' primary variable)
-    static const int wPhaseOnly = 1; //!< Only the non-wetting phase is present
-    static const int nPhaseOnly = 2; //!< Only the wetting phase is present
-    static const int bothPhases = 3; //!< Both phases are present
-
-    // Primary variable indices
-    static const int pressureIdx = PVOffset + 0;    //!< index for wetting/non-wetting phase pressure (depending on formulation) in a solution vector
-    static const int switchIdx = PVOffset + 1;      //!< index of the either the saturation or the mass fraction of the non-wetting/wetting phase
-
-    // equation indices
-    static const int conti0EqIdx = PVOffset + 0;                        //!< Reference index for mass conservation equations.
-    static const int contiWEqIdx = conti0EqIdx + FluidSystem::wCompIdx; //!< index of the mass conservation equation for the wetting phase major component
-    static const int contiNEqIdx = conti0EqIdx + FluidSystem::nCompIdx; //!< index of the mass conservation equation for the non-wetting phase major component
-};
-
-// \}
-
-}
-
-#endif
diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh
index dd9d7b6927b88a40543bbae759b74a1e5221413b..88acab3dabd478ed0c622be5dcb691b0fdc091a3 100644
--- a/dumux/porousmediumflow/2pnc/model.hh
+++ b/dumux/porousmediumflow/2pnc/model.hh
@@ -99,36 +99,64 @@
 #include <dumux/porousmediumflow/nonisothermal/model.hh>
 #include <dumux/porousmediumflow/nonisothermal/indices.hh>
 #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh>
+#include <dumux/porousmediumflow/2p/formulation.hh>
+#include <dumux/porousmediumflow/2p2c/indices.hh>
 
-#include "indices.hh"
 #include "volumevariables.hh"
 #include "primaryvariableswitch.hh"
 #include "vtkoutputfields.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup TwoPNCModel
  * \brief Specifies a number properties of two-phase n-component models.
  *
- * \Å£param nComp the number of components to be considered.
+ * \tparam nComp the number of components to be considered.
+ * \tparam useMol whether to use molar or mass balances
+ * \tparam setMoleFractionForFP whether to set mole fractions for first or second phase
  */
-template<int nComp>
+template<int nComp, bool useMol, bool setMoleFractionForFP, TwoPFormulation formulation>
 struct TwoPNCModelTraits
 {
+    using Indices = TwoPTwoCIndices;
+
     static constexpr int numEq() { return nComp; }
     static constexpr int numPhases() { return 2; }
     static constexpr int numComponents() { return nComp; }
-    static constexpr int numMajorComponents() { return 2; }
 
     static constexpr bool enableAdvection() { return true; }
     static constexpr bool enableMolecularDiffusion() { return true; }
     static constexpr bool enableEnergyBalance() { return false; }
+
+    static constexpr bool useMoles() { return useMol; }
+    static constexpr bool setMoleFractionsForFirstPhase() { return setMoleFractionForFP; }
+
+    static constexpr TwoPFormulation priVarFormulation() { return formulation; }
 };
 
-namespace Properties
+/*!
+ * \ingroup TwoPNCModel
+ * \brief Traits class for the volume variables of the single-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct TwoPNCVolumeVariablesTraits
 {
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+};
+
+
+namespace Properties {
 //////////////////////////////////////////////////////////////////
 // Type tags
 //////////////////////////////////////////////////////////////////
@@ -149,9 +177,23 @@ public:
 };
 
 SET_TYPE_PROP(TwoPNC, PrimaryVariableSwitch, TwoPNCPrimaryVariableSwitch<TypeTag>);         //!< The primary variable switch for the 2pnc model
-SET_TYPE_PROP(TwoPNC, VolumeVariables, TwoPNCVolumeVariables<TypeTag>);                     //!< the VolumeVariables property
 SET_TYPE_PROP(TwoPNC, SpatialParams, FVSpatialParams<TypeTag>);                             //!< Use the FVSpatialParams by default
 
+//! Set the volume variables property
+SET_PROP(TwoPNC, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = TwoPNCVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = TwoPNCVolumeVariables<Traits>;
+};
+
 //! Set the model traits
 SET_PROP(TwoPNC, ModelTraits)
 {
@@ -160,36 +202,25 @@ private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
 public:
-    using type = TwoPNCModelTraits<FluidSystem::numComponents>;
+    using type = TwoPNCModelTraits<FluidSystem::numComponents,
+                                   GET_PROP_VALUE(TypeTag, UseMoles),
+                                   GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase),
+                                   GET_PROP_VALUE(TypeTag, Formulation)>;
 };
 
 //! Set the vtk output fields specific to this model
-SET_PROP(TwoPNC, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-public:
-    using type = TwoPNCVtkOutputFields<FluidSystem, Indices>;
-};
+SET_TYPE_PROP(TwoPNC, VtkOutputFields, TwoPNCVtkOutputFields);
 
 SET_TYPE_PROP(TwoPNC, LocalResidual, CompositionalLocalResidual<TypeTag>);                  //!< Use the compositional local residual
 
 SET_INT_PROP(TwoPNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents); //!< Per default, no component mass balance is replaced
-SET_INT_PROP(TwoPNC, Formulation, TwoPNCFormulation::pwsn);                                 //!< Default formulation is pw-Sn, overwrite if necessary
 
-SET_BOOL_PROP(TwoPNC, SetMoleFractionsForWettingPhase, true);  //!< Set the primary variables mole fractions for the wetting or non-wetting phase
-SET_BOOL_PROP(TwoPNC, UseMoles, true);                         //!< Use mole fractions in the balance equations by default
+//! Default formulation is pw-Sn, overwrite if necessary
+SET_PROP(TwoPNC, Formulation)
+{ static constexpr auto value = TwoPFormulation::p0s1; };
 
-//! The indices required by the isothermal 2pnc model
-SET_PROP(TwoPNC, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-public:
-    using type = TwoPNCIndices<FluidSystem, /*PVOffset=*/0>;
-};
+SET_BOOL_PROP(TwoPNC, SetMoleFractionsForFirstPhase, true);  //!< Set the primary variables mole fractions for the wetting or non-wetting phase
+SET_BOOL_PROP(TwoPNC, UseMoles, true);                         //!< Use mole fractions in the balance equations by default
 
 //! Use the model after Millington (1961) for the effective diffusivity
 SET_TYPE_PROP(TwoPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
@@ -215,42 +246,24 @@ private:
     //! we use the number of components specified by the fluid system here
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
-    using IsothermalTraits = TwoPNCModelTraits<FluidSystem::numComponents>;
+    using IsothermalTraits = TwoPNCModelTraits<FluidSystem::numComponents,
+                                               GET_PROP_VALUE(TypeTag, UseMoles),
+                                               GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase),
+                                               GET_PROP_VALUE(TypeTag, Formulation)>;
 public:
     using type = PorousMediumFlowNIModelTraits<IsothermalTraits>;
 };
 
 //! Set non-isothermal output fields
-SET_PROP(TwoPNCNI, VtkOutputFields)
-{
-private:
-    using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using IsothermalFields = TwoPNCVtkOutputFields<FluidSystem, Indices>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
-
-//! set non-isothermal Indices
-SET_PROP(TwoPNCNI, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalIndices = TwoPNCIndices<FluidSystem, /*PVOffset=*/0>;
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
+SET_TYPE_PROP(TwoPNCNI, VtkOutputFields, EnergyVtkOutputFields<TwoPNCVtkOutputFields>);
 
 //! Somerton is used as default model to compute the effective thermal heat conductivity
 SET_PROP(TwoPNCNI, ThermalConductivityModel)
 {
 private:
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 public:
-    using type = ThermalConductivitySomerton<Scalar, Indices>;
+    using type = ThermalConductivitySomerton<Scalar>;
 };
 
 } // end namespace Properties
diff --git a/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh b/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh
index 1c879493636c39cd9c39b0e76808dfd9632578f5..db9ccb342548a21d21c5010ef9a5e73f4dabd39e 100644
--- a/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh
@@ -25,7 +25,7 @@
 #define DUMUX_2PNC_PRIMARY_VARIABLE_SWITCH_HH
 
 #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh>
-#include "indices.hh" // for formulation
+#include <dumux/porousmediumflow/2p/formulation.hh>
 
 namespace Dumux {
 
@@ -35,160 +35,143 @@ namespace Dumux {
  */
 template<class TypeTag>
 class TwoPNCPrimaryVariableSwitch
-: public PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPNCPrimaryVariableSwitch<TypeTag>>
+: public PrimaryVariableSwitch<TwoPNCPrimaryVariableSwitch<TypeTag>>
 {
-    using ParentType = PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPNCPrimaryVariableSwitch<TypeTag>>;
+    using ParentType = PrimaryVariableSwitch<TwoPNCPrimaryVariableSwitch<TypeTag>>;
     friend ParentType;
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    static const int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents();
-    static const int numMajorComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numMajorComponents();
-
-    enum {
-
-        switchIdx = Indices::switchIdx,
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-
-        wCompIdx = FluidSystem::wCompIdx,
-        nCompIdx = FluidSystem::nCompIdx,
-
-        wPhaseOnly = Indices::wPhaseOnly,
-        nPhaseOnly = Indices::nPhaseOnly,
-        bothPhases = Indices::bothPhases,
-
-        pwsn = TwoPNCFormulation::pwsn,
-        pnsw = TwoPNCFormulation::pnsw,
-       formulation = GET_PROP_VALUE(TypeTag, Formulation)
-    };
-
 public:
     using ParentType::ParentType;
 
 protected:
     // perform variable switch at a degree of freedom location
-    bool update_(PrimaryVariables& priVars,
+    template<class VolumeVariables, class IndexType, class GlobalPosition>
+    bool update_(typename VolumeVariables::PrimaryVariables& priVars,
                  const VolumeVariables& volVars,
                  IndexType dofIdxGlobal,
                  const GlobalPosition& globalPos)
     {
+        using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
+
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        static constexpr int phase0Idx = FluidSystem::phase0Idx;
+        static constexpr int phase1Idx = FluidSystem::phase1Idx;
+        static constexpr int comp0Idx = FluidSystem::comp0Idx;
+        static constexpr int comp1Idx = FluidSystem::comp1Idx;
+
+        static constexpr auto numComponents = VolumeVariables::numComponents();
+        static constexpr auto numMajorComponents = VolumeVariables::numPhases();
+        static constexpr auto formulation = VolumeVariables::priVarFormulation();
+        static_assert( (formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0),
+                        "Chosen TwoPFormulation not supported!");
+
+        using Indices = typename VolumeVariables::Indices;
+        static constexpr int switchIdx = Indices::switchIdx;
+
         // evaluate primary variable switch
         bool wouldSwitch = false;
         int phasePresence = priVars.state();
         int newPhasePresence = phasePresence;
 
         //check if a primary variable switch is necessary
-        if (phasePresence == bothPhases)
+        if (phasePresence == Indices::bothPhases)
         {
             Scalar Smin = 0; //saturation threshold
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            //if saturation of wetting phase is smaller 0 switch
-            if (volVars.saturation(wPhaseIdx) <= Smin)
+            // if saturation of first phase is smaller 0: switch
+            if (volVars.saturation(phase0Idx) <= Smin)
             {
                 wouldSwitch = true;
-                //wetting phase has to disappear
-                std::cout << "Wetting Phase disappears at vertex " << dofIdxGlobal
-                            << ", coordinated: " << globalPos << ", Sw: "
-                            << volVars.saturation(wPhaseIdx) << std::endl;
-                newPhasePresence = nPhaseOnly;
-
-                //switch not depending on formulation
-                //switch "Sw" to "xn20"
-                priVars[switchIdx]
-                        = volVars.moleFraction(nPhaseIdx, wCompIdx /*H2O*/);
-
-                //switch all secondary components to mole fraction in non-wetting phase
-                for (int compIdx=numMajorComponents; compIdx<numComponents; ++compIdx)
-                    priVars[compIdx] = volVars.moleFraction(nPhaseIdx,compIdx);
+                // first phase has to disappear
+                std::cout << "First Phase disappears at vertex " << dofIdxGlobal
+                            << ", coordinated: " << globalPos << ", s0: "
+                            << volVars.saturation(phase0Idx) << std::endl;
+                newPhasePresence = Indices::secondPhaseOnly;
+
+                // switch not depending on formulation, switch "S0" to "x10"
+                priVars[switchIdx] = volVars.moleFraction(phase1Idx, comp0Idx);
+
+                // switch all secondary components to mole fraction in non-wetting phase
+                for (int compIdx = numMajorComponents; compIdx < numComponents; ++compIdx)
+                    priVars[compIdx] = volVars.moleFraction(phase1Idx, compIdx);
             }
-            //if saturation of non-wetting phase is smaller than 0 switch
-            else if (volVars.saturation(nPhaseIdx) <= Smin)
+
+            // if saturation of second phase is smaller than 0: switch
+            else if (volVars.saturation(phase1Idx) <= Smin)
             {
                 wouldSwitch = true;
-                //non-wetting phase has to disappear
-                std::cout << "Non-wetting Phase disappears at vertex " << dofIdxGlobal
-                            << ", coordinated: " << globalPos << ", Sn: "
-                            << volVars.saturation(nPhaseIdx) << std::endl;
-                newPhasePresence = wPhaseOnly;
-
-                //switch "Sn" to "xwN2"
-                priVars[switchIdx] = volVars.moleFraction(wPhaseIdx, nCompIdx /*N2*/);
+                // second phase has to disappear
+                std::cout << "Second Phase disappears at vertex " << dofIdxGlobal
+                            << ", coordinated: " << globalPos << ", s1: "
+                            << volVars.saturation(phase1Idx) << std::endl;
+                newPhasePresence = Indices::firstPhaseOnly;
+
+                // switch "S1" to "x01"
+                priVars[switchIdx] = volVars.moleFraction(phase0Idx, comp1Idx);
             }
         }
-        else if (phasePresence == nPhaseOnly)
+        else if (phasePresence == Indices::secondPhaseOnly)
         {
             Scalar xwmax = 1;
             Scalar sumxw = 0;
-            //Calculate sum of mole fractions in the hypothetical wetting phase
+            // Calculate sum of mole fractions in the hypothetical first phase
             for (int compIdx = 0; compIdx < numComponents; compIdx++)
-            {
-                sumxw += volVars.moleFraction(wPhaseIdx, compIdx);
-            }
+                sumxw += volVars.moleFraction(phase0Idx, compIdx);
+
             if (sumxw > xwmax)
                 wouldSwitch = true;
             if (this->wasSwitched_[dofIdxGlobal])
-                xwmax *=1.02;
-            //wetting phase appears if sum is larger than one
+                xwmax *= 1.02;
+
+            // first phase appears if sum is larger than one
             if (sumxw/*sum of mole fractions*/ > xwmax/*1*/)
             {
-                std::cout << "Wetting Phase appears at vertex " << dofIdxGlobal
-                        << ", coordinated: " << globalPos << ", sumxw: "
+                std::cout << "First Phase appears at vertex " << dofIdxGlobal
+                        << ", coordinated: " << globalPos << ", sumx0: "
                         << sumxw << std::endl;
-                newPhasePresence = bothPhases;
+                newPhasePresence = Indices::bothPhases;
 
-                //saturation of the wetting phase set to 0.0001 (if formulation pnsw and vice versa)
-                if (formulation == pnsw)
+                // saturation of the first phase set to 0.0001 (if formulation TwoPFormulation::p1s0 and vice versa)
+                if (formulation == TwoPFormulation::p1s0)
                     priVars[switchIdx] = 0.0001;
-                else if (formulation == pwsn)
+                else
                     priVars[switchIdx] = 0.9999;
 
-                //switch all secondary components back to wetting mole fraction
-                for (int compIdx=numMajorComponents; compIdx<numComponents; ++compIdx)
-                    priVars[compIdx] = volVars.moleFraction(wPhaseIdx,compIdx);
+                // switch all secondary components back to first component mole fraction
+                for (int compIdx = numMajorComponents; compIdx < numComponents; ++compIdx)
+                    priVars[compIdx] = volVars.moleFraction(phase0Idx,compIdx);
             }
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == Indices::firstPhaseOnly)
         {
             Scalar xnmax = 1;
             Scalar sumxn = 0;
-            //Calculate sum of mole fractions in the hypothetical wetting phase
+
+            // Calculate sum of mole fractions in the hypothetical wetting phase
             for (int compIdx = 0; compIdx < numComponents; compIdx++)
-            {
-                sumxn += volVars.moleFraction(nPhaseIdx, compIdx);
-            }
+                sumxn += volVars.moleFraction(phase1Idx, compIdx);
+
             if (sumxn > xnmax)
                 wouldSwitch = true;
             if (this->wasSwitched_[dofIdxGlobal])
-                xnmax *=1.02;
-            //wetting phase appears if sum is larger than one
+                xnmax *= 1.02;
+
+            // wetting phase appears if sum is larger than one
             if (sumxn > xnmax)
             {
-                std::cout << "Non-wetting Phase appears at vertex " << dofIdxGlobal
+                std::cout << "Second Phase appears at vertex " << dofIdxGlobal
                         << ", coordinated: " << globalPos << ", sumxn: "
                         << sumxn << std::endl;
-                newPhasePresence = bothPhases;
-                //saturation of the wetting phase set to 0.9999 (if formulation pnsw and vice versa)
-                if (formulation == pnsw)
+                newPhasePresence = Indices::bothPhases;
+                //saturation of the wetting phase set to 0.9999 (if formulation TwoPFormulation::pnsw and vice versa)
+                if (formulation == TwoPFormulation::p1s0)
                     priVars[switchIdx] = 0.9999;
-                else if (formulation == pwsn)
+                else
                     priVars[switchIdx] = 0.0001;
-
             }
         }
 
-
         priVars.setState(newPhasePresence);
         this->wasSwitched_[dofIdxGlobal] = wouldSwitch;
         return phasePresence != newPhasePresence;
diff --git a/dumux/porousmediumflow/2pnc/volumevariables.hh b/dumux/porousmediumflow/2pnc/volumevariables.hh
index 919876ac1b4ccac412b8a1739e247a3a9e2d0259..589067bf5a945369f7d78039457278ba584af30a 100644
--- a/dumux/porousmediumflow/2pnc/volumevariables.hh
+++ b/dumux/porousmediumflow/2pnc/volumevariables.hh
@@ -37,7 +37,7 @@
 #include <dumux/material/constraintsolvers/computefromreferencephase.hh>
 #include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh>
 
-#include "indices.hh" // for formulation
+#include <dumux/porousmediumflow/2p/formulation.hh>
 
 namespace Dumux {
 
@@ -46,60 +46,59 @@ namespace Dumux {
  * \brief Contains the quantities which are are constant within a
  *        finite volume in the two-phase, n-component model.
  */
-template <class TypeTag>
-class TwoPNCVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class TwoPNCVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, TwoPNCVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, TwoPNCVolumeVariables<Traits>>;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using FS = typename Traits::FluidSystem;
+    using ModelTraits = typename Traits::ModelTraits;
 
     enum
     {
-        numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
-        numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(),
-        numMajorComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numMajorComponents(),
-
-        // formulations
-        formulation = GET_PROP_VALUE(TypeTag, Formulation),
-        pwsn = TwoPNCFormulation::pwsn,
-        pnsw = TwoPNCFormulation::pnsw,
+        numMajorComponents = ModelTraits::numPhases(),
 
         // phase indices
-        wPhaseIdx = FluidSystem::wPhaseIdx,
-        nPhaseIdx = FluidSystem::nPhaseIdx,
+        phase0Idx = FS::phase0Idx,
+        phase1Idx = FS::phase1Idx,
 
         // component indices
-        wCompIdx = FluidSystem::wCompIdx,
-        nCompIdx = FluidSystem::nCompIdx,
+        comp0Idx = FS::comp0Idx,
+        comp1Idx = FS::comp1Idx,
 
         // phase presence enums
-        nPhaseOnly = Indices::nPhaseOnly,
-        wPhaseOnly = Indices::wPhaseOnly,
-        bothPhases = Indices::bothPhases,
+        secondPhaseOnly = ModelTraits::Indices::secondPhaseOnly,
+        firstPhaseOnly = ModelTraits::Indices::firstPhaseOnly,
+        bothPhases = ModelTraits::Indices::bothPhases,
 
         // primary variable indices
-        pressureIdx = Indices::pressureIdx,
-        switchIdx = Indices::switchIdx,
+        pressureIdx = ModelTraits::Indices::pressureIdx,
+        switchIdx = ModelTraits::Indices::switchIdx
     };
 
-    using Element = typename GridView::template Codim<0>::Entity;
-    using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
-    using ComputeFromReferencePhase = Dumux::ComputeFromReferencePhase<Scalar, FluidSystem>;
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-    static_assert(useMoles, "use moles has to be set true in the 2pnc model");
+    static constexpr auto formulation = ModelTraits::priVarFormulation();
+    static constexpr bool setFirstPhaseMoleFractions = ModelTraits::setMoleFractionsForFirstPhase();
+
+    using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FS>;
+    using ComputeFromReferencePhase = Dumux::ComputeFromReferencePhase<Scalar, FS>;
 
 public:
+    //! export fluid state type
+    using FluidState = typename Traits::FluidState;
+    //! export fluid system type
+    using FluidSystem = typename Traits::FluidSystem;
 
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    //! return whether moles or masses are balanced
+    static constexpr bool useMoles() { return Traits::ModelTraits::useMoles(); }
+    //! return the two-phase formulation used here
+    static constexpr TwoPFormulation priVarFormulation() { return formulation; }
+
+    // check for permissive specifications
+    static_assert(useMoles(), "use moles has to be set true in the 2pnc model");
+    static_assert(ModelTraits::numPhases() == 2, "NumPhases set in the model is not two!");
+    static_assert((formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!");
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -110,51 +109,51 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub control volume
     */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
-
-        Implementation::completeFluidState(elemSol, problem, element, scv, fluidState_);
+        completeFluidState(elemSol, problem, element, scv, fluidState_);
 
         /////////////
         // calculate the remaining quantities
         /////////////
-        const auto &materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
-
         // Second instance of a parameter cache.
         // Could be avoided if diffusion coefficients also
         // became part of the fluid state.
         typename FluidSystem::ParameterCache paramCache;
         paramCache.updateAll(fluidState_);
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
-        {
-            // relative permeabilities
-            Scalar kr;
-            if (phaseIdx == wPhaseIdx)
-                kr = MaterialLaw::krw(materialParams, saturation(wPhaseIdx));
-            else // ATTENTION: krn requires the wetting-phase saturation as parameter!
-                kr = MaterialLaw::krn(materialParams, saturation(wPhaseIdx));
 
-            mobility_[phaseIdx] = kr / fluidState_.viscosity(phaseIdx);
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
+        const auto& matParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
 
-            int compIIdx = phaseIdx;
-            for (unsigned int compJIdx = 0; compJIdx < numComponents; ++compJIdx)
-            {
-                // binary diffusion coefficients
-                if(compIIdx!= compJIdx)
-                {
-                    setDiffusionCoefficient_(phaseIdx, compJIdx,
-                                             FluidSystem::binaryDiffusionCoefficient(fluidState_,
-                                                                                     paramCache,
-                                                                                     phaseIdx,
-                                                                                     compIIdx,
-                                                                                     compJIdx));
-                }
-            }
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        const int nPhaseIdx = 1 - wPhaseIdx;
+
+        // mobilities -> require wetting phase saturation as parameter!
+        mobility_[wPhaseIdx] = MaterialLaw::krw(matParams, saturation(wPhaseIdx))/fluidState_.viscosity(wPhaseIdx);
+        mobility_[nPhaseIdx] = MaterialLaw::krn(matParams, saturation(wPhaseIdx))/fluidState_.viscosity(nPhaseIdx);
+
+        // binary diffusion coefficients
+        for (unsigned int compJIdx = 0; compJIdx < ModelTraits::numComponents(); ++compJIdx)
+        {
+            if(compJIdx != comp0Idx)
+                setDiffusionCoefficient_( phase0Idx, compJIdx,
+                                          FluidSystem::binaryDiffusionCoefficient(fluidState_,
+                                                                                  paramCache,
+                                                                                  phase0Idx,
+                                                                                  comp0Idx,
+                                                                                  compJIdx) );
+            if(compJIdx != comp1Idx)
+                setDiffusionCoefficient_( phase1Idx, compJIdx,
+                                          FluidSystem::binaryDiffusionCoefficient(fluidState_,
+                                                                                  paramCache,
+                                                                                  phase1Idx,
+                                                                                  comp1Idx,
+                                                                                  compJIdx) );
         }
 
         // porosity & permeability
@@ -173,179 +172,147 @@ public:
      *
      * Set temperature, saturations, capillary pressures, viscosities, densities and enthalpies.
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
-                                   const Problem& problem,
-                                   const Element& element,
-                                   const SubControlVolume& scv,
-                                   FluidState& fluidState)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void completeFluidState(const ElemSol& elemSol,
+                            const Problem& problem,
+                            const Element& element,
+                            const Scv& scv,
+                            FluidState& fluidState)
     {
-        Scalar t = ParentType::temperature(elemSol, problem, element, scv);
+        const auto t = ParentType::temperature(elemSol, problem, element, scv);
         fluidState.setTemperature(t);
 
-        auto&& priVars = ParentType::extractDofPriVars(elemSol, scv);
+        const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
         const auto phasePresence = priVars.state();
 
-        /////////////
-        // set the saturations
-        /////////////
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
+        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        fluidState.setWettingPhase(wPhaseIdx);
 
-        Scalar Sn;
-        if (phasePresence == nPhaseOnly)
+        // set the saturations
+        if (phasePresence == secondPhaseOnly)
         {
-            Sn = 1.0;
+            fluidState.setSaturation(phase0Idx, 0.0);
+            fluidState.setSaturation(phase1Idx, 1.0);
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == firstPhaseOnly)
         {
-            Sn = 0.0;
+            fluidState.setSaturation(phase0Idx, 1.0);
+            fluidState.setSaturation(phase1Idx, 0.0);
         }
         else if (phasePresence == bothPhases)
         {
-            if (formulation == pwsn)
-                Sn = priVars[switchIdx];
-            else if (formulation == pnsw)
-                Sn = 1.0 - priVars[switchIdx];
+            if (formulation == TwoPFormulation::p0s1)
+            {
+                fluidState.setSaturation(phase1Idx, priVars[switchIdx]);
+                fluidState.setSaturation(phase0Idx, 1 - priVars[switchIdx]);
+            }
             else
-                DUNE_THROW(Dune::InvalidStateException, "Formulation: " << formulation << " is invalid.");
+            {
+                fluidState.setSaturation(phase0Idx, priVars[switchIdx]);
+                fluidState.setSaturation(phase1Idx, 1 - priVars[switchIdx]);
+            }
         }
         else
-        {
             DUNE_THROW(Dune::InvalidStateException, "phasePresence: " << phasePresence << " is invalid.");
-        }
 
-        fluidState.setSaturation(nPhaseIdx, Sn);
-        fluidState.setSaturation(wPhaseIdx, 1.0 - Sn);
-
-        /////////////
-        // set the pressures of the fluid phases
-        /////////////
-
-        // calculate capillary pressure
-        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
-        auto pc = MaterialLaw::pc(materialParams, 1 - Sn);
-
-        // extract the pressures
-        if (formulation == pwsn)
-        {
-            fluidState.setPressure(wPhaseIdx, priVars[pressureIdx]);
-            if (priVars[pressureIdx] + pc < 0.0)
-                 DUNE_THROW(NumericalProblem,"Capillary pressure is too low");
-            fluidState.setPressure(nPhaseIdx, priVars[pressureIdx] + pc);
-        }
-        else if (formulation == pnsw)
+        // set pressures of the fluid phases
+        pc_ = MaterialLaw::pc(materialParams, fluidState.saturation(wPhaseIdx));
+        if (formulation == TwoPFormulation::p0s1)
         {
-            fluidState.setPressure(nPhaseIdx, priVars[pressureIdx]);
-            // Here we check for (p_g - pc) in order to ensure that (p_l > 0)
-            if (priVars[pressureIdx] - pc < 0.0)
-            {
-                std::cout<< "p_n: "<< priVars[pressureIdx]<<" Cap_press: "<< pc << std::endl;
-                DUNE_THROW(NumericalProblem,"Capillary pressure is too high");
-            }
-            fluidState.setPressure(wPhaseIdx, priVars[pressureIdx] - pc);
+            fluidState.setPressure(phase0Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase1Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] + pc_
+                                                                       : priVars[pressureIdx] - pc_);
         }
         else
         {
-            DUNE_THROW(Dune::InvalidStateException, "Formulation: " << formulation << " is invalid.");
+            fluidState.setPressure(phase1Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase0Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] - pc_
+                                                                       : priVars[pressureIdx] + pc_);
         }
 
-        /////////////
         // calculate the phase compositions
-        /////////////
-
         typename FluidSystem::ParameterCache paramCache;
 
         // now comes the tricky part: calculate phase composition
         if (phasePresence == bothPhases)
         {
             // both phases are present, phase composition results from
-            // the nonwetting <-> wetting equilibrium. This is
-            // the job of the "MiscibleMultiPhaseComposition"
-            // constraint solver
+            // the first <-> second phase equilibrium. This is the job
+            // of the "MiscibleMultiPhaseComposition" constraint solver
 
             // set the known mole fractions in the fluidState so that they
             // can be used by the MiscibleMultiPhaseComposition constraint solver
-            unsigned int knownPhaseIdx = nPhaseIdx;
-            if (GET_PROP_VALUE(TypeTag, SetMoleFractionsForWettingPhase))
-            {
-                knownPhaseIdx = wPhaseIdx;
-            }
-
-            for (int compIdx=numMajorComponents; compIdx<numComponents; ++compIdx)
-            {
+            const int knownPhaseIdx = setFirstPhaseMoleFractions ? phase0Idx : phase1Idx;
+            for (int compIdx = numMajorComponents; compIdx < ModelTraits::numComponents(); ++compIdx)
                 fluidState.setMoleFraction(knownPhaseIdx, compIdx, priVars[compIdx]);
-            }
 
             MiscibleMultiPhaseComposition::solve(fluidState,
-                                           paramCache,
-                                           /*setViscosity=*/true,
-                                           /*setEnthalpy=*/false,
-                                           knownPhaseIdx);
+                                                 paramCache,
+                                                 /*setViscosity=*/true,
+                                                 /*setEnthalpy=*/false,
+                                                 knownPhaseIdx);
         }
-        else if (phasePresence == nPhaseOnly)
+        else if (phasePresence == secondPhaseOnly)
         {
-            Dune::FieldVector<Scalar, numComponents> moleFrac;
+            Dune::FieldVector<Scalar, ModelTraits::numComponents()> moleFrac;
 
-            moleFrac[wCompIdx] = priVars[switchIdx];
+            moleFrac[comp0Idx] = priVars[switchIdx];
+            Scalar sumMoleFracOtherComponents = moleFrac[comp0Idx];
 
-            for (int compIdx=numMajorComponents; compIdx<numComponents; ++compIdx)
+            for (int compIdx = numMajorComponents; compIdx < ModelTraits::numComponents(); ++compIdx)
+            {
                 moleFrac[compIdx] = priVars[compIdx];
-
-            Scalar sumMoleFracOtherComponents = 0;
-            for (int compIdx=numMajorComponents; compIdx<numComponents; ++compIdx)
                 sumMoleFracOtherComponents += moleFrac[compIdx];
+            }
 
-            sumMoleFracOtherComponents += moleFrac[wCompIdx];
-            moleFrac[nCompIdx] = 1 - sumMoleFracOtherComponents;
+            moleFrac[comp1Idx] = 1 - sumMoleFracOtherComponents;
 
             // Set fluid state mole fractions
-            for (int compIdx=0; compIdx<numComponents; ++compIdx)
-                fluidState.setMoleFraction(nPhaseIdx, compIdx, moleFrac[compIdx]);
+            for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++compIdx)
+                fluidState.setMoleFraction(phase1Idx, compIdx, moleFrac[compIdx]);
 
             // calculate the composition of the remaining phases (as
             // well as the densities of all phases). this is the job
             // of the "ComputeFromReferencePhase" constraint solver
             ComputeFromReferencePhase::solve(fluidState,
                                              paramCache,
-                                             nPhaseIdx,
+                                             phase1Idx,
                                              /*setViscosity=*/true,
                                              /*setEnthalpy=*/false);
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == firstPhaseOnly)
         {
-        // only the wetting phase is present, i.e. wetting phase
-        // composition is stored explicitly.
-        // extract _mass_ fractions in the non-wetting phase
-            Dune::FieldVector<Scalar, numComponents> moleFrac;
-
-            moleFrac[nCompIdx] = priVars[switchIdx];
+            // only the first phase is present, i.e. first phase composition
+            // is stored explicitly. extract _mass_ fractions in the second phase
+            Dune::FieldVector<Scalar, ModelTraits::numComponents()> moleFrac;
 
-            for (int compIdx=numMajorComponents; compIdx<numComponents; ++compIdx)
+            moleFrac[comp1Idx] = priVars[switchIdx];
+            Scalar sumMoleFracOtherComponents = moleFrac[comp1Idx];
+            for (int compIdx = numMajorComponents; compIdx < ModelTraits::numComponents(); ++compIdx)
+            {
                 moleFrac[compIdx] = priVars[compIdx];
-
-            Scalar sumMoleFracOtherComponents = 0;
-            for (int compIdx=numMajorComponents; compIdx<numComponents; ++compIdx)
                 sumMoleFracOtherComponents += moleFrac[compIdx];
+            }
 
-            sumMoleFracOtherComponents += moleFrac[nCompIdx];
-            moleFrac[wCompIdx] = 1 - sumMoleFracOtherComponents;
+            moleFrac[comp0Idx] = 1 - sumMoleFracOtherComponents;
 
             // convert mass to mole fractions and set the fluid state
-            for (int compIdx=0; compIdx<numComponents; ++compIdx)
-            {
-                fluidState.setMoleFraction(wPhaseIdx, compIdx, moleFrac[compIdx]);
-            }
+            for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++compIdx)
+                fluidState.setMoleFraction(phase0Idx, compIdx, moleFrac[compIdx]);
 
             // calculate the composition of the remaining phases (as
             // well as the densities of all phases). this is the job
             // of the "ComputeFromReferencePhase" constraint solver
             ComputeFromReferencePhase::solve(fluidState,
                                              paramCache,
-                                             wPhaseIdx,
+                                             phase0Idx,
                                              /*setViscosity=*/true,
                                              /*setEnthalpy=*/false);
         }
         paramCache.updateAll(fluidState);
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+        for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx)
         {
             Scalar rho = FluidSystem::density(fluidState, paramCache, phaseIdx);
             Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx);
@@ -379,12 +346,7 @@ public:
      * \param phaseIdx The phase index
      */
     Scalar density(int phaseIdx) const
-    {
-        if (phaseIdx < numPhases)
-            return fluidState_.density(phaseIdx);
-        else
-            DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
-    }
+    { return fluidState_.density(phaseIdx); }
 
     /*!
      * \brief Returns the kinematic viscosity of a given phase within the
@@ -393,12 +355,7 @@ public:
      * \param phaseIdx The phase index
      */
     Scalar viscosity(int phaseIdx) const
-    {
-        if (phaseIdx < numPhases)
-            return fluidState_.viscosity(phaseIdx);
-        else
-            DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
-    }
+    { return fluidState_.viscosity(phaseIdx); }
 
     /*!
      * \brief Returns the mass density of a given phase within the
@@ -407,12 +364,7 @@ public:
      * \param phaseIdx The phase index
      */
     Scalar molarDensity(int phaseIdx) const
-    {
-        if (phaseIdx < numPhases)
-            return fluidState_.molarDensity(phaseIdx);
-        else
-            DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
-    }
+    { return fluidState_.molarDensity(phaseIdx); }
 
     /*!
      * \brief Returns the effective pressure of a given phase within
@@ -447,7 +399,7 @@ public:
      *        in \f$[kg/(m*s^2)=N/m^2=Pa]\f$.
      */
     Scalar capillaryPressure() const
-    { return fluidState_.pressure(FluidSystem::nPhaseIdx) - fluidState_.pressure(FluidSystem::wPhaseIdx); }
+    { return pc_; }
 
     /*!
      * \brief Returns the average porosity within the control volume.
@@ -516,10 +468,11 @@ private:
             DUNE_THROW(Dune::InvalidStateException, "Diffusion coefficient for phaseIdx = compIdx doesn't exist");
     }
 
+    Scalar pc_;                     //!< The capillary pressure
     Scalar porosity_;               //!< Effective porosity within the control volume
     PermeabilityType permeability_; //!> Effective permeability within the control volume
-    Scalar mobility_[numPhases];    //!< Effective mobility within the control volume
-    std::array<std::array<Scalar, numComponents-1>, numPhases> diffCoefficient_;
+    Scalar mobility_[ModelTraits::numPhases()]; //!< Effective mobility within the control volume
+    std::array<std::array<Scalar, ModelTraits::numComponents()-1>, ModelTraits::numPhases()> diffCoefficient_;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh b/dumux/porousmediumflow/2pnc/vtkoutputfields.hh
index ce624d20437347867d831907969b2d0cf75f0b9c..da45474989d602f3892e4c77d0c9d06435a67cac 100644
--- a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/2pnc/vtkoutputfields.hh
@@ -34,24 +34,27 @@ namespace Dumux
  * \ingroup TwoPNCModel
  * \brief Adds vtk output fields specific to the TwoPNC model
  */
-template<class FluidSystem, class Indices>
 class TwoPNCVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
         // use default fields from the 2p model
-        TwoPVtkOutputFields<Indices>::init(vtk);
+        TwoPVtkOutputFields::init(vtk);
 
         //output additional to TwoP output:
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
-                vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x_"+ FluidSystem::phaseName(i) + "^" + FluidSystem::componentName(j));
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
+                vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },
+                                      "x_"+ FluidSystem::phaseName(i) + "^" + FluidSystem::componentName(j));
 
-        for (int j = 0; j < FluidSystem::numComponents; ++j)
-            vtk.addVolumeVariable([j](const auto& v){ return v.molarity(Indices::wPhaseIdx,j); },"m_"+ FluidSystem::phaseName(Indices::wPhaseIdx) + "^" + FluidSystem::componentName(j));
+        for (int j = 0; j < VolumeVariables::numComponents(); ++j)
+            vtk.addVolumeVariable([j](const auto& v){ return v.molarity(FluidSystem::phase0Idx,j); },
+                                  "m_"+ FluidSystem::phaseName(FluidSystem::phase1Idx) + "^" + FluidSystem::componentName(j));
 
         vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phasePresence");
     }
diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh
index a413e1075b9d91006d2d6b767835d367f20da288..a5ccef76cdb23d4bb0afe6dd16bdb99c66f587ac 100644
--- a/dumux/porousmediumflow/2pncmin/model.hh
+++ b/dumux/porousmediumflow/2pncmin/model.hh
@@ -103,10 +103,8 @@
 #include <dumux/porousmediumflow/nonisothermal/indices.hh>
 #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh>
 
-namespace Dumux
-{
-namespace Properties
-{
+namespace Dumux {
+namespace Properties {
 //////////////////////////////////////////////////////////////////
 // Type tags
 //////////////////////////////////////////////////////////////////
@@ -124,21 +122,20 @@ SET_TYPE_PROP(TwoPNCMin, LocalResidual, MineralizationLocalResidual<TypeTag>);
 SET_PROP(TwoPNCMin, VolumeVariables)
 {
 private:
-    using NonMinVolVars = TwoPNCVolumeVariables<TypeTag>;
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = TwoPNCVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+    using NonMinVolVars = TwoPNCVolumeVariables<Traits>;
 public:
-    using type = MineralizationVolumeVariables<TypeTag, NonMinVolVars>;
+    using type = MineralizationVolumeVariables<Traits, NonMinVolVars>;
 };
 
 //! Set the vtk output fields specific to this model
-SET_PROP(TwoPNCMin, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-   using NonMineralizationFields = TwoPNCVtkOutputFields<FluidSystem, Indices>;
-public:
-    using type = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>;
-};
+SET_TYPE_PROP(TwoPNCMin, VtkOutputFields, MineralizationVtkOutputFields<TwoPNCVtkOutputFields>);
 
 //! The 2pnc model traits define the non-mineralization part
 SET_PROP(TwoPNCMin, ModelTraits)
@@ -147,7 +144,10 @@ private:
     //! we use the number of components specified by the fluid system here
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
-    using NonMineralizationTraits = TwoPNCModelTraits<FluidSystem::numComponents>;
+    using NonMineralizationTraits = TwoPNCModelTraits<FluidSystem::numComponents,
+                                                      GET_PROP_VALUE(TypeTag, UseMoles),
+                                                      GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase),
+                                                      GET_PROP_VALUE(TypeTag, Formulation)>;
 public:
     using type = MineralizationModelTraits<NonMineralizationTraits, FluidSystem::numSPhases>;
 };
@@ -163,7 +163,10 @@ private:
     //! we use the number of components specified by the fluid system here
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!");
-    using TwoPNCTraits = TwoPNCModelTraits<FluidSystem::numComponents>;
+    using TwoPNCTraits = TwoPNCModelTraits<FluidSystem::numComponents,
+                                           GET_PROP_VALUE(TypeTag, UseMoles),
+                                           GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase),
+                                           GET_PROP_VALUE(TypeTag, Formulation)>;
     using IsothermalTraits = MineralizationModelTraits<TwoPNCTraits, FluidSystem::numSPhases>;
 public:
     // the mineralization traits, based on 2pnc traits, are the isothermal traits
@@ -171,16 +174,8 @@ public:
 };
 
 //! non-isothermal vtkoutput
-SET_PROP(TwoPNCMinNI, VtkOutputFields)
-{
-private:
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using NonMineralizationFields = TwoPNCVtkOutputFields<FluidSystem, Indices>;
-    using IsothermalFields = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
+SET_TYPE_PROP(TwoPNCMinNI, VtkOutputFields, EnergyVtkOutputFields<MineralizationVtkOutputFields<TwoPNCVtkOutputFields>>);
+
 } // end namespace Properties
 } // end namespace Dumux
 
diff --git a/dumux/porousmediumflow/3p/indices.hh b/dumux/porousmediumflow/3p/indices.hh
index 7c539c0e738719e313a2e2790bfa70f32e1bdbd0..c19e37cced0aa621302d549a911562ed17e3e33f 100644
--- a/dumux/porousmediumflow/3p/indices.hh
+++ b/dumux/porousmediumflow/3p/indices.hh
@@ -24,44 +24,24 @@
 #ifndef DUMUX_3P_INDICES_HH
 #define DUMUX_3P_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup ThreePModel
  * \brief The common indices for the isothermal three-phase model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class FluidSystem, int PVOffset = 0>
 class ThreePIndices
 {
 public:
-    // Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< index of the wetting liquid phase
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< index of the nonwetting liquid phase
-    static const int gPhaseIdx = FluidSystem::gPhaseIdx; //!< index of the gas phase
-
-
     // Primary variable indices
-    static const int pressureIdx = PVOffset + 0; //!< index for gas phase pressure in a solution vector
-    static const int swIdx = PVOffset + 1; //!< index of water (more wetting than the other liquid) saturation
-    static const int snIdx = PVOffset + 2; //!< index of (e.g.) NAPL saturation
-
+    static constexpr int pressureIdx = 0; //!< index for gas phase pressure in a solution vector
+    static constexpr int swIdx = 1; //!< index of water (more wetting than the other liquid) saturation
+    static constexpr int snIdx = 2; //!< index of (e.g.) NAPL saturation
 
     // equation indices
-    static const int conti0EqIdx = PVOffset    + wPhaseIdx; //!< index of the mass conservation equation for the water component
-    static const int conti1EqIdx = conti0EqIdx + nPhaseIdx; //!< index of the mass conservation equation for the contaminant component
-    static const int conti2EqIdx = conti0EqIdx + gPhaseIdx; //!< index of the mass conservation equation for the air component
-
-    static const int contiWEqIdx = conti0EqIdx + wPhaseIdx; //!< index of the mass conservation equation for the water component
-    static const int contiNEqIdx = conti0EqIdx + nPhaseIdx; //!< index of the mass conservation equation for the contaminant component
-    static const int contiGEqIdx = conti0EqIdx + gPhaseIdx; //!< index of the mass conservation equation for the air component
+    static constexpr int conti0EqIdx = 0; //!< index of first balance equation
 };
 
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/3p/model.hh b/dumux/porousmediumflow/3p/model.hh
index aa27451b0b0cafd6847fd9a3a2b4d187fba40f00..b77f95116562c3c2a2af6685e1af29db9c7e8465 100644
--- a/dumux/porousmediumflow/3p/model.hh
+++ b/dumux/porousmediumflow/3p/model.hh
@@ -80,6 +80,8 @@ namespace Dumux {
  */
 struct ThreePModelTraits
 {
+    using Indices = ThreePIndices;
+
     static constexpr int numEq() { return 3; }
     static constexpr int numPhases() { return 3; }
     static constexpr int numComponents() { return 3; }
@@ -89,6 +91,26 @@ struct ThreePModelTraits
     static constexpr bool enableEnergyBalance() { return false; }
 };
 
+/*!
+ * \ingroup ThreePModel
+ * \brief Traits class for the two-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct ThreePVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+};
+
 namespace Properties {
 
 //////////////////////////////////////////////////////////////////
@@ -117,16 +139,19 @@ SET_PROP(ThreeP, ModelTraits)
 //! The local residual function of the conservation equations
 SET_TYPE_PROP(ThreeP, LocalResidual, ImmiscibleLocalResidual<TypeTag>);
 
-//! The VolumeVariables property
-SET_TYPE_PROP(ThreeP, VolumeVariables, ThreePVolumeVariables<TypeTag>);
-
-//! The indices required by the isothermal 3p model
-SET_PROP(ThreeP, Indices)
+//! Set the volume variables property
+SET_PROP(ThreeP, VolumeVariables)
 {
 private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = ThreePVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
 public:
-    using type = ThreePIndices<FluidSystem,/*PVOffset=*/0>;
+    using type = ThreePVolumeVariables<Traits>;
 };
 
 //! The spatial parameters to be employed.
@@ -153,10 +178,10 @@ public:
 SET_PROP(ThreeP, VtkOutputFields)
 {
 private:
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+   using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
 public:
-    using type = ThreePVtkOutputFields<Indices>;
+    using type = ThreePVtkOutputFields;
 };
 
 /////////////////////////////////////////////////
@@ -168,32 +193,20 @@ SET_PROP(ThreePNI, ThermalConductivityModel)
 {
 private:
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 public:
-    using type = ThermalConductivitySomerton<Scalar, Indices>;
+    using type = ThermalConductivitySomerton<Scalar>;
 };
 
 //! Set non-isothermal output fields
 SET_PROP(ThreePNI, VtkOutputFields)
 {
 private:
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using IsothermalFields = ThreePVtkOutputFields<Indices>;
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using IsothermalFields = ThreePVtkOutputFields;
 public:
     using type = EnergyVtkOutputFields<IsothermalFields>;
 };
 
-//! Set non-isothermal Indices
-SET_PROP(ThreePNI, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalIndices = ThreePIndices<FluidSystem,/*PVOffset=*/0>;
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 //! Set non-isothermal model traits
 SET_PROP(ThreePNI, ModelTraits)
 {
diff --git a/dumux/porousmediumflow/3p/volumevariables.hh b/dumux/porousmediumflow/3p/volumevariables.hh
index 3a447893771d700d27deb7bdd65638a9c767195a..c5af2649f15f7ae070c9b3e66a96f962bc6e53c0 100644
--- a/dumux/porousmediumflow/3p/volumevariables.hh
+++ b/dumux/porousmediumflow/3p/volumevariables.hh
@@ -24,11 +24,9 @@
 #ifndef DUMUX_3P_VOLUME_VARIABLES_HH
 #define DUMUX_3P_VOLUME_VARIABLES_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/material/constants.hh>
 #include <dumux/material/fluidstates/immiscible.hh>
 #include <dumux/porousmediumflow/volumevariables.hh>
-#include <dumux/discretization/methods.hh>
 
 namespace Dumux {
 
@@ -36,30 +34,23 @@ namespace Dumux {
  * \ingroup ThreePModel
  * \brief Contains the quantities which are constant within a finite volume in the three-phase model.
  */
-template <class TypeTag>
-class ThreePVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class ThreePVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, ThreePVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, ThreePVolumeVariables<Traits>>;
+
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using Indices = typename Traits::ModelTraits::Indices;
+    using FS = typename Traits::FluidSystem;
+
     enum {
-        numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
+        numPhases = Traits::ModelTraits::numPhases(),
 
-        wPhaseIdx = Indices::wPhaseIdx,
-        gPhaseIdx = Indices::gPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+        wPhaseIdx = FS::wPhaseIdx,
+        gPhaseIdx = FS::gPhaseIdx,
+        nPhaseIdx = FS::nPhaseIdx,
 
         swIdx = Indices::swIdx,
         snIdx = Indices::snIdx,
@@ -67,8 +58,10 @@ class ThreePVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
     };
 
 public:
-
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    //! export fluid state type
+    using FluidState = typename Traits::FluidState;
+    //! export fluid system type
+    using FluidSystem = typename Traits::FluidSystem;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -79,15 +72,16 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub control volume
     */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
 
         // capillary pressure parameters
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
 
         completeFluidState(elemSol, problem, element, scv, fluidState_);
@@ -122,11 +116,11 @@ public:
      *
      * Set temperature, saturations, capillary pressures, viscosities, densities and enthalpies.
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static void completeFluidState(const ElemSol& elemSol,
                                    const Problem& problem,
                                    const Element& element,
-                                   const SubControlVolume& scv,
+                                   const Scv& scv,
                                    FluidState& fluidState)
     {
         Scalar t = ParentType::temperature(elemSol, problem, element, scv);
@@ -149,6 +143,7 @@ public:
         const Scalar pg = priVars[pressureIdx];
 
         // calculate capillary pressures
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const Scalar pcgw = MaterialLaw::pcgw(materialParams, sw);
         const Scalar pcnw = MaterialLaw::pcnw(materialParams, sw);
         const Scalar pcgn = MaterialLaw::pcgn(materialParams, sw + sn);
@@ -255,18 +250,14 @@ public:
     { return permeability_; }
 
 protected:
-    Scalar porosity_;
-    PermeabilityType permeability_;
-    Scalar mobility_[numPhases];
     FluidState fluidState_;
 
 private:
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
-
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
+    Scalar porosity_;
+    PermeabilityType permeability_;
+    Scalar mobility_[numPhases];
 };
-} // end namespace
+
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/3p/vtkoutputfields.hh b/dumux/porousmediumflow/3p/vtkoutputfields.hh
index 810d8611e7938b535d20a7021c4a37e2ba697095..8fb983196a0a4d381bb6781a2cc6a95ca7a25d90 100644
--- a/dumux/porousmediumflow/3p/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/3p/vtkoutputfields.hh
@@ -24,33 +24,30 @@
 #ifndef DUMUX_THREEP_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_THREEP_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup ThreePModel
  * \brief Adds vtk output fields specific to the three-phase model
  */
-template<class Indices>
 class ThreePVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using FluidSystem = typename VtkOutputModule::VolumeVariables::FluidSystem;
+
         // register standardized vtk output fields
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "sw");
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::nPhaseIdx); },"sn");
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::gPhaseIdx); },"sg");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::wPhaseIdx); },"pw");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::nPhaseIdx); },"pn");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::gPhaseIdx); },"pg");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::wPhaseIdx); },"rhow");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::nPhaseIdx); },"rhon");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::gPhaseIdx); },"rhog");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::wPhaseIdx); }, "sw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::nPhaseIdx); },"sn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::gPhaseIdx); },"sg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::wPhaseIdx); },"pw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::nPhaseIdx); },"pn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::gPhaseIdx); },"pg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::wPhaseIdx); },"rhow");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::nPhaseIdx); },"rhon");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::gPhaseIdx); },"rhog");
         vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity");
         vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability");
     }
diff --git a/dumux/porousmediumflow/3p3c/indices.hh b/dumux/porousmediumflow/3p3c/indices.hh
index 52c0273716bddaa19c808254208464ee00cdcf99..c4c8eea3be303e75986a1a4b8014649054cd60e7 100644
--- a/dumux/porousmediumflow/3p3c/indices.hh
+++ b/dumux/porousmediumflow/3p3c/indices.hh
@@ -24,62 +24,37 @@
 #ifndef DUMUX_3P3C_INDICES_HH
 #define DUMUX_3P3C_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup ThreePThreeCModel
  * \brief The indices for the isothermal three-phase three-component model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class FluidSystem, int PVOffset = 0>
 class ThreePThreeCIndices
 {
 public:
-    // Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< index of the wetting liquid phase
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< index of the nonwetting liquid phase
-    static const int gPhaseIdx = FluidSystem::gPhaseIdx; //!< index of the gas phase
-
-    // Component indices to indicate the main component
-    // of the corresponding phase at atmospheric pressure 1 bar
-    // and room temperature 20°C:
-    static const int wCompIdx = FluidSystem::wCompIdx;
-    static const int nCompIdx = FluidSystem::nCompIdx;
-    static const int gCompIdx = FluidSystem::gCompIdx;
-
     // present phases (-> 'pseudo' primary variable)
-    static const int threePhases = 1; //!< All three phases are present
-    static const int wPhaseOnly = 2; //!< Only the water phase is present
-    static const int gnPhaseOnly = 3; //!< Only gas and NAPL phases are present
-    static const int wnPhaseOnly = 4; //!< Only water and NAPL phases are present
-    static const int gPhaseOnly = 5; //!< Only gas phase is present
-    static const int wgPhaseOnly = 6; //!< Only water and gas phases are present
+    static constexpr int threePhases = 1; //!< All three phases are present
+    static constexpr int wPhaseOnly = 2; //!< Only the water phase is present
+    static constexpr int gnPhaseOnly = 3; //!< Only gas and NAPL phases are present
+    static constexpr int wnPhaseOnly = 4; //!< Only water and NAPL phases are present
+    static constexpr int gPhaseOnly = 5; //!< Only gas phase is present
+    static constexpr int wgPhaseOnly = 6; //!< Only water and gas phases are present
 
     // Primary variable indices
-    static const int pressureIdx = PVOffset + 0; //!< index for gas phase pressure in a solution vector
-    static const int switch1Idx = PVOffset + 1; //!< index 1 of saturation or mole fraction
-    static const int switch2Idx = PVOffset + 2; //!< index 2 of saturation or mole fraction
+    static constexpr int pressureIdx = 0; //!< index for gas phase pressure in a solution vector
+    static constexpr int switch1Idx = 1; //!< index 1 of saturation or mole fraction
+    static constexpr int switch2Idx = 2; //!< index 2 of saturation or mole fraction
 
     //! index for gas phase pressure in a solution vector
-    static const int pgIdx = pressureIdx;
+    static constexpr int pgIdx = pressureIdx;
     //! index of either the saturation of the wetting phase or the mole fraction secondary component if a phase is not present
-    static const int sOrX1Idx = switch1Idx;
+    static constexpr int sOrX1Idx = switch1Idx;
     //! index of either the saturation of the nonwetting phase or the mole fraction secondary component if a phase is not present
-    static const int sOrX2Idx = switch2Idx;
+    static constexpr int sOrX2Idx = switch2Idx;
 
     // equation indices
-    static const int conti0EqIdx = PVOffset    + wCompIdx; //!< index of the mass conservation equation for the water component
-    static const int conti1EqIdx = conti0EqIdx + nCompIdx; //!< index of the mass conservation equation for the contaminant component
-    static const int conti2EqIdx = conti0EqIdx + gCompIdx; //!< index of the mass conservation equation for the gas component
-
-    static const int contiWEqIdx = conti0EqIdx + wCompIdx; //!< index of the mass conservation equation for the water component
-    static const int contiNEqIdx = conti0EqIdx + nCompIdx; //!< index of the mass conservation equation for the contaminant component
-    static const int contiGEqIdx = conti0EqIdx + gCompIdx; //!< index of the mass conservation equation for the air component
+    static constexpr int conti0EqIdx = 0;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/3p3c/localresidual.hh b/dumux/porousmediumflow/3p3c/localresidual.hh
index ce42b0113862c178d6d3e4531ed99ad93b6274cd..9ef032a51eb3a5724352240fef8db8df61a0e2bc 100644
--- a/dumux/porousmediumflow/3p3c/localresidual.hh
+++ b/dumux/porousmediumflow/3p3c/localresidual.hh
@@ -37,10 +37,9 @@ namespace Dumux
  * This class is used to fill the gaps in BoxLocalResidual for the 3P3C flow.
  */
 template<class TypeTag>
-class ThreePThreeCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
+class ThreePThreeCLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
 {
     using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual);
-    using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
@@ -49,28 +48,29 @@ class ThreePThreeCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual);
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     enum {
         numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
         numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(),
 
-        conti0EqIdx = Indices::conti0EqIdx,//!< index of the mass conservation equation for the water component
-        conti1EqIdx = Indices::conti1EqIdx,//!< index of the mass conservation equation for the contaminant component
-        conti2EqIdx = Indices::conti2EqIdx,//!< index of the mass conservation equation for the gas component
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wPhaseIdx,//!< index of the mass conservation equation for the water component
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nPhaseIdx,//!< index of the mass conservation equation for the contaminant component
+        contiGEqIdx = Indices::conti0EqIdx + FluidSystem::gPhaseIdx,//!< index of the mass conservation equation for the gas component
 
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-        gPhaseIdx = Indices::gPhaseIdx,
+        wPhaseIdx = FluidSystem::wPhaseIdx,
+        nPhaseIdx = FluidSystem::nPhaseIdx,
+        gPhaseIdx = FluidSystem::gPhaseIdx,
 
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
-        gCompIdx = Indices::gCompIdx
+        wCompIdx = FluidSystem::wCompIdx,
+        nCompIdx = FluidSystem::nCompIdx,
+        gCompIdx = FluidSystem::gCompIdx
     };
 
 public:
@@ -99,7 +99,7 @@ public:
         {
             for (int compIdx = 0; compIdx < numComponents; ++compIdx)
             {
-                auto eqIdx = conti0EqIdx + compIdx;
+                auto eqIdx = Indices::conti0EqIdx + compIdx;
                 storage[eqIdx] += volVars.porosity()
                                   * volVars.saturation(phaseIdx)
                                   * volVars.molarDensity(phaseIdx)
@@ -149,7 +149,7 @@ public:
                 { return volVars.molarDensity(phaseIdx)*volVars.moleFraction(phaseIdx, compIdx)*volVars.mobility(phaseIdx); };
 
                 // get equation index
-                auto eqIdx = conti0EqIdx + compIdx;
+                auto eqIdx = Indices::conti0EqIdx + compIdx;
                 flux[eqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
             }
 
@@ -178,21 +178,14 @@ public:
         Scalar jGN = 0.0;
         Scalar jNN = 0.0;
 
-        flux[conti0EqIdx] += jWW+jWG+jWN;
-        flux[conti1EqIdx] += jNW+jNG+jNN;
-        flux[conti2EqIdx] += jGW+jGG+jGN;
+        flux[contiWEqIdx] += jWW+jWG+jWN;
+        flux[contiNEqIdx] += jNW+jNG+jNN;
+        flux[contiGEqIdx] += jGW+jGG+jGN;
 
         return flux;
     }
-
-protected:
-    Implementation *asImp_()
-    { return static_cast<Implementation *> (this); }
-
-    const Implementation *asImp_() const
-    { return static_cast<const Implementation *> (this); }
 };
 
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh
index 285740f4f3e41ec29fa9fd955b8ef5f53e0b5e68..8c7db24472488cda97d9ef5af209420bd8dd2d0c 100644
--- a/dumux/porousmediumflow/3p3c/model.hh
+++ b/dumux/porousmediumflow/3p3c/model.hh
@@ -103,9 +103,13 @@ namespace Dumux {
 /*!
  * \ingroup ThreePThreeCModel
  * \brief Specifies a number properties of two-phase models.
+ * \param useCS if we are using the contraint solver
  */
+template<bool useCS, bool useMol>
 struct ThreePThreeCModelTraits
 {
+    using Indices = ThreePThreeCIndices;
+
     static constexpr int numEq() { return 3; }
     static constexpr int numPhases() { return 3; }
     static constexpr int numComponents() { return 3; }
@@ -113,6 +117,29 @@ struct ThreePThreeCModelTraits
     static constexpr bool enableAdvection() { return true; }
     static constexpr bool enableMolecularDiffusion() { return true; }
     static constexpr bool enableEnergyBalance() { return false; }
+
+    static constexpr bool useConstraintSolver() { return useCS; }
+    static constexpr bool useMoles() { return useMol; }
+};
+
+/*!
+ * \ingroup ThreePThreeCModel
+ * \brief Traits class for the 3p3c model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct ThreePThreeCVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
 };
 
 namespace Properties {
@@ -133,10 +160,13 @@ private:
     static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!");
     static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!");
 public:
-    using type = ThreePThreeCModelTraits;
+    using type = ThreePThreeCModelTraits<GET_PROP_VALUE(TypeTag, UseConstraintSolver), GET_PROP_VALUE(TypeTag, UseMoles)>;
 };
 
-//! Set as default that no component mass balance is replaced by the total mass balance
+//! Determines whether a constraint solver should be used explicitly
+SET_BOOL_PROP(ThreePThreeC, UseConstraintSolver, false);
+
+//! Set as default that _no_ component mass balance is replaced by the total mass balance
 SET_INT_PROP(ThreePThreeC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents());
 /*!
  * \brief The fluid state which is used by the volume variables to
@@ -156,7 +186,7 @@ SET_PROP(ThreePThreeC, FluidState){
 SET_TYPE_PROP(ThreePThreeC, LocalResidual, ThreePThreeCLocalResidual<TypeTag>);
 
 //! The primary variable switch for the 3p3c model
-SET_TYPE_PROP(ThreePThreeC, PrimaryVariableSwitch, ThreePThreeCPrimaryVariableSwitch<TypeTag>);
+SET_TYPE_PROP(ThreePThreeC, PrimaryVariableSwitch, ThreePThreeCPrimaryVariableSwitch);
 
 //! The primary variables vector for the 3p3c model
 SET_PROP(ThreePThreeC, PrimaryVariables)
@@ -168,19 +198,19 @@ public:
     using type = SwitchablePrimaryVariables<PrimaryVariablesVector, int>;
 };
 
-//! the VolumeVariables property
-SET_TYPE_PROP(ThreePThreeC, VolumeVariables, ThreePThreeCVolumeVariables<TypeTag>);
-
-//! Determines whether a constraint solver should be used explicitly
-SET_BOOL_PROP(ThreePThreeC, UseConstraintSolver, false);
-
-//! The indices required by the isothermal 3p3c model
-SET_PROP(ThreePThreeC, Indices)
+//! Set the volume variables property
+SET_PROP(ThreePThreeC, VolumeVariables)
 {
 private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = ThreePThreeCVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
 public:
-    using type = ThreePThreeCIndices<FluidSystem, /*PVOffset=*/0>;
+    using type = ThreePThreeCVolumeVariables<Traits>;
 };
 
 //! The spatial parameters to be employed.
@@ -188,51 +218,21 @@ public:
 SET_TYPE_PROP(ThreePThreeC, SpatialParams, FVSpatialParams<TypeTag>);
 
 //! The model after Millington (1961) is used for the effective diffusivity
-SET_PROP(ThreePThreeC, EffectiveDiffusivityModel)
-{ private :
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
- public:
-    using type = DiffusivityMillingtonQuirk<Scalar>;
-};
+SET_TYPE_PROP(ThreePThreeC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
 //! Set the vtk output fields specific to this model
-SET_PROP(ThreePThreeC, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-public:
-    using type = ThreePThreeCVtkOutputFields<FluidSystem, Indices>;
-};
+SET_TYPE_PROP(ThreePThreeC, VtkOutputFields, ThreePThreeCVtkOutputFields);
 
 //! Use mole fractions in the balance equations by default
 SET_BOOL_PROP(ThreePThreeC, UseMoles, true);
 
 //! Somerton is used as default model to compute the effective thermal heat conductivity
-SET_PROP(ThreePThreeCNI, ThermalConductivityModel)
-{
-private:
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-public:
-    using type = ThermalConductivitySomerton<Scalar, Indices>;
-};
+SET_TYPE_PROP(ThreePThreeCNI, ThermalConductivityModel, ThermalConductivitySomerton<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
 //////////////////////////////////////////////////////////////////
 // Property values for isothermal model required for the general non-isothermal model
 //////////////////////////////////////////////////////////////////
 
-//! Set non-isothermal Indices
-SET_PROP(ThreePThreeCNI, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalIndices = ThreePThreeCIndices<FluidSystem, /*PVOffset=*/0>;
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 //! Set non-isothermal NumEq
 SET_PROP(ThreePThreeCNI, ModelTraits)
 {
@@ -240,23 +240,15 @@ private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!");
     static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!");
+    using IsothermalModelTraits = ThreePThreeCModelTraits<GET_PROP_VALUE(TypeTag, UseConstraintSolver), GET_PROP_VALUE(TypeTag, UseMoles)>;
 public:
-    using type = PorousMediumFlowNIModelTraits<ThreePThreeCModelTraits>;
+    using type = PorousMediumFlowNIModelTraits<IsothermalModelTraits>;
 };
 
 //! Set the non-isothermal vktoutputfields
-SET_PROP(ThreePThreeCNI, VtkOutputFields)
-{
-private:
-    using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using IsothermalFields = ThreePThreeCVtkOutputFields<FluidSystem, Indices>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
+SET_TYPE_PROP(ThreePThreeCNI, VtkOutputFields, EnergyVtkOutputFields<ThreePThreeCVtkOutputFields>);
 
 } // end namespace Properties
-
 } // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh b/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh
index 64bfa8595df39352f10465108796a52267025da3..d2ce4ffc37b1c5c9b5dc6352e73a335fd21e4e22 100644
--- a/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh
@@ -24,7 +24,6 @@
 #ifndef DUMUX_3P3C_PRIMARY_VARIABLE_SWITCH_HH
 #define DUMUX_3P3C_PRIMARY_VARIABLE_SWITCH_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh>
 
 namespace Dumux {
@@ -33,112 +32,88 @@ namespace Dumux {
  * \ingroup ThreePThreeCModel
  * \brief The primary variable switch controlling the phase presence state variable
  */
-template<class TypeTag>
 class ThreePThreeCPrimaryVariableSwitch
-: public PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), ThreePThreeCPrimaryVariableSwitch<TypeTag>>
+: public PrimaryVariableSwitch<ThreePThreeCPrimaryVariableSwitch>
 {
-    using ParentType = PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), ThreePThreeCPrimaryVariableSwitch<TypeTag>>;
+    using ParentType = PrimaryVariableSwitch<ThreePThreeCPrimaryVariableSwitch>;
     friend ParentType;
 
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum {
-        switch1Idx = Indices::switch1Idx,
-        switch2Idx = Indices::switch2Idx,
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-        gPhaseIdx = Indices::gPhaseIdx,
-
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
-        gCompIdx = Indices::gCompIdx,
-
-        threePhases = Indices::threePhases,
-        wPhaseOnly  = Indices::wPhaseOnly,
-        gnPhaseOnly = Indices::gnPhaseOnly,
-        wnPhaseOnly = Indices::wnPhaseOnly,
-        gPhaseOnly  = Indices::gPhaseOnly,
-        wgPhaseOnly = Indices::wgPhaseOnly
-    };
-
 public:
     using ParentType::ParentType;
 
 protected:
 
     // perform variable switch at a degree of freedom location
-    bool update_(PrimaryVariables& priVars,
+    template<class VolumeVariables, class GlobalPosition>
+    bool update_(typename VolumeVariables::PrimaryVariables& priVars,
                  const VolumeVariables& volVars,
-                 IndexType dofIdxGlobal,
+                 std::size_t dofIdxGlobal,
                  const GlobalPosition& globalPos)
     {
+        using PrimaryVariables = typename VolumeVariables::PrimaryVariables;
+        using Scalar = typename PrimaryVariables::value_type;
+        using Indices = typename VolumeVariables::Indices;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
         // evaluate if the primary variable switch would switch
         bool wouldSwitch = false;
         auto phasePresence = priVars.state();
         auto newPhasePresence = phasePresence;
 
         // check if a primary variable switch is necessary
-        if (phasePresence == threePhases)
+        if (phasePresence == Indices::threePhases)
         {
             Scalar Smin = 0;
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(gPhaseIdx) <= Smin)
+            if (volVars.saturation(FluidSystem::gPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // gas phase disappears
                 std::cout << "Gas phase disappears at dof " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sg: "
-                          << volVars.saturation(gPhaseIdx) << std::endl;
-                newPhasePresence = wnPhaseOnly;
+                          << volVars.saturation(FluidSystem::gPhaseIdx) << std::endl;
+                newPhasePresence = Indices::wnPhaseOnly;
 
-                priVars[switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx);
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx);
             }
-            else if (volVars.saturation(wPhaseIdx) <= Smin)
+            else if (volVars.saturation(FluidSystem::wPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // water phase disappears
                 std::cout << "Water phase disappears at dof " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sw: "
-                          << volVars.saturation(wPhaseIdx) << std::endl;
-                newPhasePresence = gnPhaseOnly;
+                          << volVars.saturation(FluidSystem::wPhaseIdx) << std::endl;
+                newPhasePresence = Indices::gnPhaseOnly;
 
-                priVars[switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx);
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx);
             }
-            else if (volVars.saturation(nPhaseIdx) <= Smin)
+            else if (volVars.saturation(FluidSystem::nPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // NAPL phase disappears
                 std::cout << "NAPL phase disappears at dof " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sn: "
-                          << volVars.saturation(nPhaseIdx) << std::endl;
-                newPhasePresence = wgPhaseOnly;
+                          << volVars.saturation(FluidSystem::nPhaseIdx) << std::endl;
+                newPhasePresence = Indices::wgPhaseOnly;
 
-                priVars[switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx);
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             }
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == Indices::wPhaseOnly)
         {
             bool gasPresent = false;
             bool nonwettingPresent = false;
             // calculate fractions of the partial pressures in the
             // hypothetical gas phase
-            Scalar xwg = volVars.moleFraction(gPhaseIdx, wCompIdx);
-            Scalar xgg = volVars.moleFraction(gPhaseIdx, gCompIdx);
-            Scalar xng = volVars.moleFraction(gPhaseIdx, nCompIdx);
+            Scalar xwg = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx);
+            Scalar xgg = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::gCompIdx);
+            Scalar xng = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             /* take care:
-               for xgg in case wPhaseOnly we compute xgg=henry_air*x2w
-               for xwg in case wPhaseOnly we compute xwg=pwsat
-               for xng in case wPhaseOnly we compute xng=henry_NAPL*x1w
+               for xgg in case Indices::wPhaseOnly we compute xgg=henry_air*x2w
+               for xwg in case Indices::wPhaseOnly we compute xwg=pwsat
+               for xng in case Indices::wPhaseOnly we compute xng=henry_NAPL*x1w
             */
 
             Scalar xgMax = 1.0;
@@ -159,9 +134,9 @@ protected:
             }
 
             // calculate fractions in the hypothetical NAPL phase
-            Scalar xnn = volVars.moleFraction(nPhaseIdx, nCompIdx);
+            Scalar xnn = volVars.moleFraction(FluidSystem::nPhaseIdx, FluidSystem::nCompIdx);
             /* take care:
-               for xnn in case wPhaseOnly we compute xnn=henry_mesitylene*x1w,
+               for xnn in case Indices::wPhaseOnly we compute xnn=henry_mesitylene*x1w,
                where a hypothetical gas pressure is assumed for the Henry
                x0n is set to NULL  (all NAPL phase is dirty)
                x2n is set to NULL  (all NAPL phase is dirty)
@@ -186,24 +161,24 @@ protected:
 
             if (gasPresent && !nonwettingPresent)
             {
-                newPhasePresence = wgPhaseOnly;
-                priVars[switch1Idx] = 0.9999;
-                priVars[switch2Idx] = 0.0001;
+                newPhasePresence = Indices::wgPhaseOnly;
+                priVars[Indices::switch1Idx] = 0.9999;
+                priVars[Indices::switch2Idx] = 0.0001;
             }
             else if (gasPresent && nonwettingPresent)
             {
-                newPhasePresence = threePhases;
-                priVars[switch1Idx] = 0.9999;
-                priVars[switch2Idx] = 0.0001;
+                newPhasePresence = Indices::threePhases;
+                priVars[Indices::switch1Idx] = 0.9999;
+                priVars[Indices::switch2Idx] = 0.0001;
             }
             else if (!gasPresent && nonwettingPresent)
             {
-                newPhasePresence = wnPhaseOnly;
-                priVars[switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx);
-                priVars[switch2Idx] = 0.0001;
+                newPhasePresence = Indices::wnPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx);
+                priVars[Indices::switch2Idx] = 0.0001;
             }
         }
-        else if (phasePresence == gnPhaseOnly)
+        else if (phasePresence == Indices::gnPhaseOnly)
         {
             bool nonwettingPresent = false;
             bool wettingPresent = false;
@@ -212,19 +187,19 @@ protected:
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(nPhaseIdx) <= Smin)
+            if (volVars.saturation(FluidSystem::nPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // NAPL phase disappears
                 std::cout << "NAPL phase disappears at dof " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sn: "
-                          << volVars.saturation(nPhaseIdx) << std::endl;
+                          << volVars.saturation(FluidSystem::nPhaseIdx) << std::endl;
                 nonwettingPresent = true;
             }
 
 
             // calculate fractions of the hypothetical water phase
-            Scalar xww = volVars.moleFraction(wPhaseIdx, wCompIdx);
+            Scalar xww = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::wCompIdx);
             /*
               take care:, xww, if no water is present, then take xww=xwg*pg/pwsat .
               If this is larger than 1, then water appears
@@ -248,24 +223,24 @@ protected:
 
             if (wettingPresent && !nonwettingPresent)
             {
-                newPhasePresence = threePhases;
-                priVars[switch1Idx] = 0.0001;
-                priVars[switch2Idx] = volVars.saturation(nPhaseIdx);
+                newPhasePresence = Indices::threePhases;
+                priVars[Indices::switch1Idx] = 0.0001;
+                priVars[Indices::switch2Idx] = volVars.saturation(FluidSystem::nPhaseIdx);
             }
             else if (wettingPresent && nonwettingPresent)
             {
-                newPhasePresence = wgPhaseOnly;
-                priVars[switch1Idx] = 0.0001;
-                priVars[switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx);
+                newPhasePresence = Indices::wgPhaseOnly;
+                priVars[Indices::switch1Idx] = 0.0001;
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             }
             else if (!wettingPresent && nonwettingPresent)
             {
-                newPhasePresence = gPhaseOnly;
-                priVars[switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx);
-                priVars[switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx);
+                newPhasePresence = Indices::gPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx);
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             }
         }
-        else if (phasePresence == wnPhaseOnly)
+        else if (phasePresence == Indices::wnPhaseOnly)
         {
             bool nonwettingPresent = false;
             bool gasPresent = false;
@@ -274,25 +249,25 @@ protected:
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(nPhaseIdx) <= Smin)
+            if (volVars.saturation(FluidSystem::nPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // NAPL phase disappears
                 std::cout << "NAPL phase disappears at dof " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sn: "
-                          << volVars.saturation(nPhaseIdx) << std::endl;
+                          << volVars.saturation(FluidSystem::nPhaseIdx) << std::endl;
                 nonwettingPresent = true;
             }
 
             // calculate fractions of the partial pressures in the
             // hypothetical gas phase
-            Scalar xwg = volVars.moleFraction(gPhaseIdx, wCompIdx);
-            Scalar xgg = volVars.moleFraction(gPhaseIdx, gCompIdx);
-            Scalar xng = volVars.moleFraction(gPhaseIdx, nCompIdx);
+            Scalar xwg = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx);
+            Scalar xgg = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::gCompIdx);
+            Scalar xng = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             /* take care:
-               for xgg in case wPhaseOnly we compute xgg=henry_air*x2w
-               for xwg in case wPhaseOnly we compute xwg=pwsat
-               for xng in case wPhaseOnly we compute xng=henry_NAPL*x1w
+               for xgg in case Indices::wPhaseOnly we compute xgg=henry_air*x2w
+               for xwg in case Indices::wPhaseOnly we compute xwg=pwsat
+               for xng in case Indices::wPhaseOnly we compute xng=henry_NAPL*x1w
             */
             Scalar xgMax = 1.0;
             if (xwg + xgg + xng > xgMax)
@@ -313,30 +288,30 @@ protected:
 
             if (gasPresent && !nonwettingPresent)
             {
-                newPhasePresence = threePhases;
-                priVars[switch1Idx] = volVars.saturation(wPhaseIdx);
-                priVars[switch2Idx] = volVars.saturation(nPhaseIdx);
+                newPhasePresence = Indices::threePhases;
+                priVars[Indices::switch1Idx] = volVars.saturation(FluidSystem::wPhaseIdx);
+                priVars[Indices::switch2Idx] = volVars.saturation(FluidSystem::nPhaseIdx);
             }
             else if (gasPresent && nonwettingPresent)
             {
-                newPhasePresence = wgPhaseOnly;
-                priVars[switch1Idx] = volVars.saturation(wPhaseIdx);
-                priVars[switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx);
+                newPhasePresence = Indices::wgPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.saturation(FluidSystem::wPhaseIdx);
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             }
             else if (!gasPresent && nonwettingPresent)
             {
-                newPhasePresence = wPhaseOnly;
-                priVars[switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx);
-                priVars[switch2Idx] = volVars.moleFraction(wPhaseIdx, nCompIdx);
+                newPhasePresence = Indices::wPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx);
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx);
             }
         }
-        else if (phasePresence == gPhaseOnly)
+        else if (phasePresence == Indices::gPhaseOnly)
         {
             bool nonwettingPresent = false;
             bool wettingPresent = false;
 
             // calculate fractions in the hypothetical NAPL phase
-            Scalar xnn = volVars.moleFraction(nPhaseIdx, nCompIdx);
+            Scalar xnn = volVars.moleFraction(FluidSystem::nPhaseIdx, FluidSystem::nCompIdx);
             /*
               take care:, xnn, if no NAPL phase is there, take xnn=xng*pg/pcsat
               if this is larger than 1, then NAPL appears
@@ -359,7 +334,7 @@ protected:
                 nonwettingPresent = true;
             }
             // calculate fractions of the hypothetical water phase
-            Scalar xww = volVars.moleFraction(wPhaseIdx, wCompIdx);
+            Scalar xww = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::wCompIdx);
             /*
               take care:, xww, if no water is present, then take xww=xwg*pg/pwsat .
               If this is larger than 1, then water appears
@@ -382,31 +357,31 @@ protected:
             }
             if (wettingPresent && !nonwettingPresent)
             {
-                newPhasePresence = wgPhaseOnly;
-                priVars[switch1Idx] = 0.0001;
-                priVars[switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx);
+                newPhasePresence = Indices::wgPhaseOnly;
+                priVars[Indices::switch1Idx] = 0.0001;
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             }
             else if (wettingPresent && nonwettingPresent)
             {
-                newPhasePresence = threePhases;
-                priVars[switch1Idx] = 0.0001;
-                priVars[switch2Idx] = 0.0001;
+                newPhasePresence = Indices::threePhases;
+                priVars[Indices::switch1Idx] = 0.0001;
+                priVars[Indices::switch2Idx] = 0.0001;
             }
             else if (!wettingPresent && nonwettingPresent)
             {
-                newPhasePresence = gnPhaseOnly;
-                priVars[switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx);
-                priVars[switch2Idx] = 0.0001;
+                newPhasePresence = Indices::gnPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx);
+                priVars[Indices::switch2Idx] = 0.0001;
             }
         }
-        else if (phasePresence == wgPhaseOnly)
+        else if (phasePresence == Indices::wgPhaseOnly)
         {
             bool nonwettingPresent = false;
             bool gasPresent = false;
             bool wettingPresent = false;
 
             // get the fractions in the hypothetical NAPL phase
-            Scalar xnn = volVars.moleFraction(nPhaseIdx, nCompIdx);
+            Scalar xnn = volVars.moleFraction(FluidSystem::nPhaseIdx, FluidSystem::nCompIdx);
 
             // take care: if the NAPL phase is not present, take
             // xnn=xng*pg/pcsat if this is larger than 1, then NAPL
@@ -432,13 +407,13 @@ protected:
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(gPhaseIdx) <= Smin)
+            if (volVars.saturation(FluidSystem::gPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // gas phase disappears
                 std::cout << "Gas phase disappears at dof " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sg: "
-                          << volVars.saturation(gPhaseIdx) << std::endl;
+                          << volVars.saturation(FluidSystem::gPhaseIdx) << std::endl;
                 gasPresent = true;
             }
 
@@ -446,39 +421,39 @@ protected:
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(wPhaseIdx) <= Smin)
+            if (volVars.saturation(FluidSystem::wPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // gas phase disappears
                 std::cout << "Water phase disappears at dof " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sw: "
-                          << volVars.saturation(wPhaseIdx) << std::endl;
+                          << volVars.saturation(FluidSystem::wPhaseIdx) << std::endl;
                 wettingPresent = true;
             }
 
             if (!gasPresent && nonwettingPresent && wettingPresent)
             {
-                newPhasePresence = gnPhaseOnly;
-                priVars[switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx);
-                priVars[switch2Idx] = 0.0001;
+                newPhasePresence = Indices::gnPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx);
+                priVars[Indices::switch2Idx] = 0.0001;
             }
             else if (!gasPresent && nonwettingPresent && !wettingPresent)
             {
-                newPhasePresence = threePhases;
-                priVars[switch1Idx] = volVars.saturation(wPhaseIdx);
-                priVars[switch2Idx] = 0.0;
+                newPhasePresence = Indices::threePhases;
+                priVars[Indices::switch1Idx] = volVars.saturation(FluidSystem::wPhaseIdx);
+                priVars[Indices::switch2Idx] = 0.0;
             }
             else if (gasPresent && !nonwettingPresent && !wettingPresent)
             {
-                newPhasePresence = wPhaseOnly;
-                priVars[switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx);
-                priVars[switch2Idx] = volVars.moleFraction(wPhaseIdx, nCompIdx);
+                newPhasePresence = Indices::wPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx);
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx);
             }
             else if (!gasPresent && !nonwettingPresent && wettingPresent)
             {
-                newPhasePresence = gPhaseOnly;
-                priVars[switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx);
-                priVars[switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx);
+                newPhasePresence = Indices::gPhaseOnly;
+                priVars[Indices::switch1Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx);
+                priVars[Indices::switch2Idx] = volVars.moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx);
             }
         }
 
diff --git a/dumux/porousmediumflow/3p3c/volumevariables.hh b/dumux/porousmediumflow/3p3c/volumevariables.hh
index 7dbbfab8e179bb26503f10a621f793a2448b2fcf..b89ca04a2005763e61a7968384ac73ae89290677 100644
--- a/dumux/porousmediumflow/3p3c/volumevariables.hh
+++ b/dumux/porousmediumflow/3p3c/volumevariables.hh
@@ -25,13 +25,11 @@
 #ifndef DUMUX_3P3C_VOLUME_VARIABLES_HH
 #define DUMUX_3P3C_VOLUME_VARIABLES_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/material/constants.hh>
 #include <dumux/material/fluidstates/compositional.hh>
 #include <dumux/material/constraintsolvers/computefromreferencephase.hh>
 #include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh>
 #include <dumux/porousmediumflow/volumevariables.hh>
-#include <dumux/discretization/methods.hh>
 
 namespace Dumux {
 
@@ -40,56 +38,52 @@ namespace Dumux {
  * \brief Contains the quantities which are are constant within a
  *        finite volume in the three-phase three-component model.
  */
-template <class TypeTag>
-class ThreePThreeCVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class ThreePThreeCVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, ThreePThreeCVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
-    using ComputeFromReferencePhase = Dumux::ComputeFromReferencePhase<Scalar, FluidSystem>;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
-        numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
-        numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(),
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, ThreePThreeCVolumeVariables<Traits>>;
+
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
+
+    using FS = typename Traits::FluidSystem;
+    using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FS>;
+    using ComputeFromReferencePhase = Dumux::ComputeFromReferencePhase<Scalar, FS>;
 
-        wCompIdx = Indices::wCompIdx,
-        gCompIdx = Indices::gCompIdx,
-        nCompIdx = Indices::nCompIdx,
+    using ModelTraits = typename Traits::ModelTraits;
+    using Idx = typename ModelTraits::Indices;
+    enum {
+        wCompIdx = FS::wCompIdx,
+        gCompIdx = FS::gCompIdx,
+        nCompIdx = FS::nCompIdx,
 
-        wPhaseIdx = Indices::wPhaseIdx,
-        gPhaseIdx = Indices::gPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+        wPhaseIdx = FS::wPhaseIdx,
+        gPhaseIdx = FS::gPhaseIdx,
+        nPhaseIdx = FS::nPhaseIdx,
 
-        switch1Idx = Indices::switch1Idx,
-        switch2Idx = Indices::switch2Idx,
-        pressureIdx = Indices::pressureIdx
+        switch1Idx = Idx::switch1Idx,
+        switch2Idx = Idx::switch2Idx,
+        pressureIdx = Idx::pressureIdx
     };
 
     // present phases
     enum {
-        threePhases = Indices::threePhases,
-        wPhaseOnly  = Indices::wPhaseOnly,
-        gnPhaseOnly = Indices::gnPhaseOnly,
-        wnPhaseOnly = Indices::wnPhaseOnly,
-        gPhaseOnly  = Indices::gPhaseOnly,
-        wgPhaseOnly = Indices::wgPhaseOnly
+        threePhases = Idx::threePhases,
+        wPhaseOnly  = Idx::wPhaseOnly,
+        gnPhaseOnly = Idx::gnPhaseOnly,
+        wnPhaseOnly = Idx::wnPhaseOnly,
+        gPhaseOnly  = Idx::gPhaseOnly,
+        wgPhaseOnly = Idx::wgPhaseOnly
     };
 
-    using Element = typename GridView::template Codim<0>::Entity;
-
 public:
-
-   using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    //! export fluid state type
+    using FluidState = typename Traits::FluidState;
+    //! export fluid system type
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export the indices
+    using Indices = typename ModelTraits::Indices;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -100,17 +94,17 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub control volume
     */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
         const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
         const auto phasePresence = priVars.state();
 
-        bool useConstraintSolver = GET_PROP_VALUE(TypeTag, UseConstraintSolver);
+        constexpr bool useConstraintSolver = ModelTraits::useConstraintSolver();
 
         // capillary pressure parameters
         const auto &materialParams =
@@ -169,6 +163,7 @@ public:
         pg_ = priVars[pressureIdx];
 
         // calculate capillary pressures
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         Scalar pcgw = MaterialLaw::pcgw(materialParams, sw_);
         Scalar pcnw = MaterialLaw::pcnw(materialParams, sw_);
         Scalar pcgn = MaterialLaw::pcgn(materialParams, sw_ + sn_);
@@ -189,10 +184,10 @@ public:
         // depend on composition!
         typename FluidSystem::ParameterCache paramCache;
         // assert(FluidSystem::isIdealGas(gPhaseIdx));
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
+        for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++ phaseIdx) {
             assert(FluidSystem::isIdealMixture(phaseIdx));
 
-            for (int compIdx = 0; compIdx < numComponents; ++ compIdx) {
+            for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++ compIdx) {
                 Scalar phi = FluidSystem::fugacityCoefficient(fluidState_, paramCache, phaseIdx, compIdx);
                 fluidState_.setFugacityCoefficient(phaseIdx, compIdx, phi);
             }
@@ -510,7 +505,7 @@ public:
             DUNE_THROW(Dune::InvalidStateException, "phasePresence: " << phasePresence << " is invalid.");
         }
 
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
+        for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) {
             // Mobilities
             const Scalar mu =
                 FluidSystem::viscosity(fluidState_,
@@ -551,7 +546,7 @@ public:
         permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
 
         // compute and set the enthalpy
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+        for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx)
         {
             Scalar h = ParentType::enthalpy(fluidState_, paramCache, phaseIdx);
             fluidState_.setEnthalpy(phaseIdx, h);
@@ -679,19 +674,19 @@ public:
     }
 
 protected:
+    FluidState fluidState_;
 
+private:
     Scalar sw_, sg_, sn_, pg_, pw_, pn_;
 
-    Scalar moleFrac_[numPhases][numComponents];
-    Scalar massFrac_[numPhases][numComponents];
+    Scalar moleFrac_[ModelTraits::numPhases()][ModelTraits::numComponents()];
+    Scalar massFrac_[ModelTraits::numPhases()][ModelTraits::numComponents()];
 
     Scalar porosity_;        //!< Effective porosity within the control volume
     PermeabilityType permeability_; //!< Effective permeability within the control volume
-    Scalar mobility_[numPhases];  //!< Effective mobility within the control volume
+    Scalar mobility_[ModelTraits::numPhases()];  //!< Effective mobility within the control volume
     Scalar bulkDensTimesAdsorpCoeff_; //!< the basis for calculating adsorbed NAPL
-    FluidState fluidState_;
 
-private:
     void setDiffusionCoefficient_(int phaseIdx, int compIdx, Scalar d)
     {
         if (compIdx < phaseIdx)
@@ -704,13 +699,7 @@ private:
             DUNE_THROW(Dune::InvalidStateException, "Diffusion coefficient for phaseIdx = compIdx doesn't exist");
     }
 
-    std::array<std::array<Scalar, numComponents-1>, numPhases> diffCoefficient_;
-
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
-
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
+    std::array<std::array<Scalar, ModelTraits::numComponents()-1>, ModelTraits::numPhases()> diffCoefficient_;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh b/dumux/porousmediumflow/3p3c/vtkoutputfields.hh
index 58453fb2c5dfe990179f900fbb16aba8c9df27fb..d8d4c37b45f62e8ef3f9fca5e61716042a96d374 100644
--- a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/3p3c/vtkoutputfields.hh
@@ -24,36 +24,34 @@
 #ifndef DUMUX_THREEPTHREEC_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_THREEPTHREEC_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup ThreePThreeCModel
  * \brief Adds vtk output fields specific to the three-phase three-component model
  */
-template<class FluidSystem, class Indices>
 class ThreePThreeCVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
         // register standardized vtk output fields
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::nPhaseIdx); },"Sn");
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::gPhaseIdx); },"Sg");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::wPhaseIdx); },"pw");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::nPhaseIdx); },"pn");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::gPhaseIdx); },"pg");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::wPhaseIdx); },"rhow");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::nPhaseIdx); },"rhon");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::gPhaseIdx); },"rhog");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::wPhaseIdx); }, "Sw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::nPhaseIdx); },"Sn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::gPhaseIdx); },"Sg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::wPhaseIdx); },"pw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::nPhaseIdx); },"pn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::gPhaseIdx); },"pg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::wPhaseIdx); },"rhow");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::nPhaseIdx); },"rhon");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::gPhaseIdx); },"rhog");
 
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
                 vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },
                                       "x^" + FluidSystem::componentName(j) + "_" +  FluidSystem::phaseName(i));
 
diff --git a/dumux/porousmediumflow/3pwateroil/indices.hh b/dumux/porousmediumflow/3pwateroil/indices.hh
index 5287096bcfd357ce4abdcd6a78df27029ba68853..6a9dc1245dc2fc21d3e6e56b54dc9e0bc7bc2150 100644
--- a/dumux/porousmediumflow/3pwateroil/indices.hh
+++ b/dumux/porousmediumflow/3pwateroil/indices.hh
@@ -24,33 +24,15 @@
 #ifndef DUMUX_3P2CNI_INDICES_HH
 #define DUMUX_3P2CNI_INDICES_HH
 
-#include <dumux/common/properties.hh>
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup ThreePWaterOilModel
  * \brief The indices for the isothermal 3p2cni model.
- *
- * \tparam FluidSystem The fluid system class
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class FluidSystem, int PVOffset = 0>
 class ThreePWaterOilIndices
 {
 public:
-    // Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< index of the wetting liquid phase
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< index of the nonwetting liquid phase
-    static const int gPhaseIdx = FluidSystem::gPhaseIdx; //!< index of the gas phase
-
-    // Component indices to indicate the main component
-    // of the corresponding phase at atmospheric pressure 1 bar
-    // and room temperature 20°C:
-    static const int wCompIdx = FluidSystem::wCompIdx;
-    static const int nCompIdx = FluidSystem::nCompIdx;
-    static const int gCompIdx = -1; //!< dummy index for compatibility with 3p3c
-
     // present phases (-> 'pseudo' primary variable)
     static const int threePhases = 1; //!< All three phases are present
     static const int wPhaseOnly = 2; //!< Only the water phase is present
@@ -60,19 +42,14 @@ public:
     static const int wgPhaseOnly = 6; //!< Only water and gas phases are present
 
     // Primary variable indices
-    static const int pressureIdx = PVOffset + 0; //!< Index for phase pressure in a solution vector
-    static const int switch1Idx = PVOffset + 1; //!< Index 1 of saturation, mole fraction or temperature
-    static const int switch2Idx = PVOffset + 2; //!< Index 2 of saturation, mole fraction or temperature
+    static const int pressureIdx = 0; //!< Index for phase pressure in a solution vector
+    static const int switch1Idx = 1; //!< Index 1 of saturation, mole fraction or temperature
+    static const int switch2Idx = 2; //!< Index 2 of saturation, mole fraction or temperature
 
     // equation indices
-    static const int conti0EqIdx = PVOffset    + wCompIdx; //!< Index of the mass conservation equation for the water component
-    static const int conti1EqIdx = conti0EqIdx + nCompIdx; //!< Index of the mass conservation equation for the contaminant component
-    static const int conti2EqIdx = -1; //!< dummy index for compatibility with 3p3c
-
-    static const int contiWEqIdx = conti0EqIdx + wCompIdx; //!< index of the mass conservation equation for the water component
-    static const int contiNEqIdx = conti0EqIdx + nCompIdx; //!< index of the mass conservation equation for the contaminant component
+    static const int conti0EqIdx = 0; //!< Index of the mass conservation equation for the water component
 };
 
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/3pwateroil/localresidual.hh b/dumux/porousmediumflow/3pwateroil/localresidual.hh
index 95697b854ddad84ae802856d2994c30de7eca4da..c713b228376c2c0a3482ebf62acb07bcf4bc607d 100644
--- a/dumux/porousmediumflow/3pwateroil/localresidual.hh
+++ b/dumux/porousmediumflow/3pwateroil/localresidual.hh
@@ -26,10 +26,8 @@
 #define DUMUX_3P2CNI_LOCAL_RESIDUAL_HH
 
 #include <dumux/common/properties.hh>
-#include <dumux/porousmediumflow/3p3c/localresidual.hh>
 
-namespace Dumux
-{
+namespace Dumux {
 /*!
  * \ingroup ThreePWaterOilModel
  * \brief Element-wise calculation of the local residual for problems
@@ -38,11 +36,10 @@ namespace Dumux
  * This class is used to fill the gaps in the CompositionalLocalResidual for the 3PWaterOil flow.
  */
 template<class TypeTag>
-class ThreePWaterOilLocalResidual: public ThreePThreeCLocalResidual<TypeTag>
+class ThreePWaterOilLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
 {
 protected:
-    using ParentType = ThreePThreeCLocalResidual<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual);
+    using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
@@ -51,27 +48,27 @@ protected:
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual);
-
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     enum {
         numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
         numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(),
 
         conti0EqIdx = Indices::conti0EqIdx,//!< Index of the mass conservation equation for the water component
-        conti1EqIdx = Indices::conti1EqIdx,//!< Index of the mass conservation equation for the contaminant component
+        conti1EqIdx = conti0EqIdx + 1,//!< Index of the mass conservation equation for the contaminant component
 
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-        gPhaseIdx = Indices::gPhaseIdx,
+        wPhaseIdx = FluidSystem::wPhaseIdx,
+        nPhaseIdx = FluidSystem::nPhaseIdx,
+        gPhaseIdx = FluidSystem::gPhaseIdx,
 
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
+        wCompIdx = FluidSystem::wCompIdx,
+        nCompIdx = FluidSystem::nCompIdx,
     };
 
     //! property that defines whether mole or mass fractions are used
@@ -193,20 +190,8 @@ public:
 
         return flux;
     }
-
-
-protected:
-    Implementation *asImp_()
-    {
-        return static_cast<Implementation *> (this);
-    }
-
-    const Implementation *asImp_() const
-    {
-        return static_cast<const Implementation *> (this);
-    }
 };
 
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh
index db3238c8bc97fb76b906ae2993c839f97cc78f60..82be7e253a85af352cbeab8d824b0a1bce8d80e6 100644
--- a/dumux/porousmediumflow/3pwateroil/model.hh
+++ b/dumux/porousmediumflow/3pwateroil/model.hh
@@ -91,22 +91,46 @@
 #include "primaryvariableswitch.hh"
 #include "vtkoutputfields.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup ThreePWaterOilModel
  * \brief Specifies a number properties of the three-phase two-component model.
  */
+template<bool onlyGasPhase>
 struct ThreePWaterOilModelTraits
 {
- static constexpr int numEq() { return 2; }
- static constexpr int numPhases() { return 3; }
- static constexpr int numComponents() { return 2; }
+    using Indices = ThreePWaterOilIndices;
+
+    static constexpr int numEq() { return 2; }
+    static constexpr int numPhases() { return 3; }
+    static constexpr int numComponents() { return 2; }
+
+    static constexpr bool enableAdvection() { return true; }
+    static constexpr bool enableMolecularDiffusion() { return true; }
+    static constexpr bool enableEnergyBalance() { return false; }
 
- static constexpr bool enableAdvection() { return true; }
- static constexpr bool enableMolecularDiffusion() { return true; }
- static constexpr bool enableEnergyBalance() { return false; }
+    static constexpr bool onlyGasPhaseCanDisappear() { return onlyGasPhase; }
+};
+
+/*!
+ * \ingroup ThreePWaterOilModel
+ * \brief Traits class for the two-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct ThreePWaterOilVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
 };
 
 namespace Properties {
@@ -125,7 +149,7 @@ private:
     static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 3p2cni model!");
     static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p2cni model!");
 public:
-    using type = PorousMediumFlowNIModelTraits<ThreePWaterOilModelTraits>;
+    using type = PorousMediumFlowNIModelTraits<ThreePWaterOilModelTraits<GET_PROP_VALUE(TypeTag, OnlyGasPhaseCanDisappear)>>;
 };
 
 /*!
@@ -164,8 +188,20 @@ public:
 //! Determines whether a constraint solver should be used explicitly
 SET_BOOL_PROP(ThreePWaterOilNI, OnlyGasPhaseCanDisappear, true);
 
-//! the VolumeVariables property
-SET_TYPE_PROP(ThreePWaterOilNI, VolumeVariables, ThreePWaterOilVolumeVariables<TypeTag>);
+//! Set the volume variables property
+SET_PROP(ThreePWaterOilNI, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = ThreePWaterOilVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = ThreePWaterOilVolumeVariables<Traits>;
+};
 
 //! The spatial parameters to be employed.
 //! Use FVSpatialParams by default.
@@ -183,33 +219,14 @@ SET_PROP(ThreePWaterOilNI, ThermalConductivityModel)
 {
 private:
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 public:
-    using type = ThermalConductivitySomerton<Scalar, Indices>;
+    using type = ThermalConductivitySomerton<Scalar>;
 };
 
 //! Set the non-isothermal vkt output fields
-SET_PROP(ThreePWaterOilNI, VtkOutputFields)
-{
-private:
-    using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using IsothermalFields = ThreePWaterOilVtkOutputFields<FluidSystem, Indices>;
-public:
-    using type = EnergyVtkOutputFields<IsothermalFields>;
-};
+SET_TYPE_PROP(ThreePWaterOilNI, VtkOutputFields, EnergyVtkOutputFields<ThreePWaterOilVtkOutputFields>);
 
-//set non-isothermal Indices
-SET_PROP(ThreePWaterOilNI, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalIndices =  ThreePWaterOilIndices<FluidSystem, /*PVOffset=*/0>;
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
+} // end namespace Properties
+} // end namespace Dumux
 
-}
-}
 #endif
diff --git a/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh b/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh
index 86742b50d60f60c9ea83c2d6d1cbd1e996135c9d..8037a59ee1b550cd340359951b309fd384fb15b5 100644
--- a/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh
@@ -35,9 +35,9 @@ namespace Dumux {
  */
 template<class TypeTag>
 class ThreePWaterOilPrimaryVariableSwitch
-: public PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), ThreePWaterOilPrimaryVariableSwitch<TypeTag>>
+: public PrimaryVariableSwitch<ThreePWaterOilPrimaryVariableSwitch<TypeTag>>
 {
-    using ParentType = PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), ThreePWaterOilPrimaryVariableSwitch<TypeTag>>;
+    using ParentType = PrimaryVariableSwitch<ThreePWaterOilPrimaryVariableSwitch<TypeTag>>;
     friend ParentType;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
@@ -47,20 +47,20 @@ class ThreePWaterOilPrimaryVariableSwitch
 
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     enum {
         switch1Idx = Indices::switch1Idx,
         switch2Idx = Indices::switch2Idx,
         pressureIdx = Indices::pressureIdx,
 
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-        gPhaseIdx = Indices::gPhaseIdx,
+        wPhaseIdx = FluidSystem::wPhaseIdx,
+        nPhaseIdx = FluidSystem::nPhaseIdx,
+        gPhaseIdx = FluidSystem::gPhaseIdx,
 
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
-        gCompIdx = Indices::gCompIdx,
+        wCompIdx = FluidSystem::wCompIdx,
+        nCompIdx = FluidSystem::nCompIdx,
 
         threePhases = Indices::threePhases,
         wPhaseOnly  = Indices::wPhaseOnly,
diff --git a/dumux/porousmediumflow/3pwateroil/volumevariables.hh b/dumux/porousmediumflow/3pwateroil/volumevariables.hh
index 7b7cf5f635a292dca2abaa677b977061deee6bfa..4af2eadc3652b89078d88497d36159a900d5a83f 100644
--- a/dumux/porousmediumflow/3pwateroil/volumevariables.hh
+++ b/dumux/porousmediumflow/3pwateroil/volumevariables.hh
@@ -47,31 +47,27 @@ namespace Dumux {
  * \brief Contains the quantities which are are constant within a
  *        finite volume in the three-phase, two-component model.
  */
-template <class TypeTag>
-class ThreePWaterOilVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class ThreePWaterOilVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, ThreePWaterOilVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, ThreePWaterOilVolumeVariables<Traits>>;
+
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using ModelTraits = typename Traits::ModelTraits;
+    using Indices = typename ModelTraits::Indices;
+    using FS = typename Traits::FluidSystem;
 
     enum {
-        numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(),
-        numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(),
+        numPs = ParentType::numPhases(),
+        numComps = ParentType::numComponents(),
 
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
+        wCompIdx = FS::wCompIdx,
+        nCompIdx = FS::nCompIdx,
 
-        wPhaseIdx = Indices::wPhaseIdx,
-        gPhaseIdx = Indices::gPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+        wPhaseIdx = FS::wPhaseIdx,
+        gPhaseIdx = FS::gPhaseIdx,
+        nPhaseIdx = FS::nPhaseIdx,
 
         switch1Idx = Indices::switch1Idx,
         switch2Idx = Indices::switch2Idx,
@@ -88,30 +84,29 @@ class ThreePWaterOilVolumeVariables : public PorousMediumFlowVolumeVariables<Typ
         wgPhaseOnly = Indices::wgPhaseOnly
     };
 
-    using Element = typename GridView::template Codim<0>::Entity;
-
 public:
     //! The type of the object returned by the fluidState() method
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-    using ParentType::enthalpy;
-
+    using FluidState = typename Traits::FluidState;
+    //! The type of the fluid system
+    using FluidSystem = typename Traits::FluidSystem;
 
     /*!
      * \copydoc ImplicitVolumeVariables::update
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
         const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
         const auto phasePresence = priVars.state();
 
-        bool onlyGasPhaseCanDisappear = GET_PROP_VALUE(TypeTag, OnlyGasPhaseCanDisappear);
+        bool onlyGasPhaseCanDisappear = Traits::ModelTraits::onlyGasPhaseCanDisappear();
 
         // capillary pressure parameters
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
 
         if(!onlyGasPhaseCanDisappear)
@@ -631,7 +626,7 @@ public:
             else DUNE_THROW(Dune::InvalidStateException, "phasePresence: " << phasePresence << " is invalid.");
             }
 
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
+        for (int phaseIdx = 0; phaseIdx < numPs; ++phaseIdx) {
             // Mobilities
             const Scalar mu =
                 FluidSystem::viscosity(fluidState_,
@@ -671,7 +666,7 @@ public:
 
 //         fluidState_.setTemperature(temp_);
         // the enthalpies (internal energies are directly calculated in the fluidstate
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
+        for (int phaseIdx = 0; phaseIdx < numPs; ++phaseIdx) {
             Scalar h = FluidSystem::enthalpy(fluidState_, phaseIdx);
             fluidState_.setEnthalpy(phaseIdx, h);
 
@@ -784,7 +779,7 @@ public:
      * \brief Returns the diffusivity coefficient matrix
      */
     DUNE_DEPRECATED_MSG("diffusionCoefficient() is deprecated. Use diffusionCoefficient(int phaseIdx) instead.")
-    Dune::FieldVector<Scalar, numPhases> diffusionCoefficient() const
+    Dune::FieldVector<Scalar, numPs> diffusionCoefficient() const
     {
         return diffusionCoefficient_;
     }
@@ -822,30 +817,24 @@ public:
     { return fluidState_.enthalpy(phaseIdx); };
 
 protected:
+    FluidState fluidState_;
 
+private:
     Scalar sw_, sg_, sn_, pg_, pw_, pn_, temp_;
 
-    Scalar moleFrac_[numPhases][numComponents];
-    Scalar massFrac_[numPhases][numComponents];
+    Scalar moleFrac_[numPs][numComps];
+    Scalar massFrac_[numPs][numComps];
 
     Scalar porosity_;        //!< Effective porosity within the control volume
     Scalar permeability_;        //!< Effective porosity within the control volume
-    Scalar mobility_[numPhases];  //!< Effective mobility within the control volume
+    Scalar mobility_[numPs];  //!< Effective mobility within the control volume
     Scalar bulkDensTimesAdsorpCoeff_; //!< the basis for calculating adsorbed NAPL
     /* We need a tensor here !! */
     //!< Binary diffusion coefficients of the 3 components in the phases
-    Dune::FieldVector<Scalar, numPhases> diffusionCoefficient_;
-    FluidState fluidState_;
-
-private:
-    std::array<std::array<Scalar, numComponents-1>, numPhases> diffCoefficient_;
-
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
+    Dune::FieldVector<Scalar, numPs> diffusionCoefficient_;
+    std::array<std::array<Scalar, numComps-1>, numPs> diffCoefficient_;
 
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
 };
-} // end namespace
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh b/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh
index 11b9e0265a1f69d27606de3580dae29b90a60efb..eb3719d7a8f4465996da5cb0e2868ecdc10c1520 100644
--- a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh
@@ -24,16 +24,12 @@
 #ifndef DUMUX_3P2CNI_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_3P2CNI_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup ThreePWaterOilModel
  * \brief Adds vtk output fields specific to the three-phase three-component model
  */
-template<class FluidSystem, class Indices>
 class ThreePWaterOilVtkOutputFields
 {
 
@@ -41,27 +37,30 @@ public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
         // register standardized vtk output fields
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "sw");
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::nPhaseIdx); },"sn");
-        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(Indices::gPhaseIdx); },"sg");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::wPhaseIdx); },"pw");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::nPhaseIdx); },"pn");
-        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(Indices::gPhaseIdx); },"pg");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::wPhaseIdx); },"rhow");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::nPhaseIdx); },"rhon");
-        vtk.addVolumeVariable( [](const auto& v){ return v.density(Indices::gPhaseIdx); },"rhog");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::wPhaseIdx); }, "sw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::nPhaseIdx); },"sn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::gPhaseIdx); },"sg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::wPhaseIdx); },"pw");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::nPhaseIdx); },"pn");
+        vtk.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::gPhaseIdx); },"pg");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::wPhaseIdx); },"rhow");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::nPhaseIdx); },"rhon");
+        vtk.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::gPhaseIdx); },"rhog");
         vtk.addVolumeVariable( [](const auto& v){ return
-        v.mobility(Indices::wPhaseIdx); },"MobW");
-        vtk.addVolumeVariable( [](const auto& v){ return v.mobility(Indices::nPhaseIdx); },"MobN");
-        vtk.addVolumeVariable( [](const auto& v){ return v.mobility(Indices::gPhaseIdx); },"MobG");
+        v.mobility(FluidSystem::wPhaseIdx); },"MobW");
+        vtk.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::nPhaseIdx); },"MobN");
+        vtk.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::gPhaseIdx); },"MobG");
         vtk.addVolumeVariable( [](const auto& v){ return
-        v.viscosity(Indices::wPhaseIdx); },"ViscosW");
-        vtk.addVolumeVariable( [](const auto& v){ return v.viscosity(Indices::nPhaseIdx); },"ViscosN");
-        vtk.addVolumeVariable( [](const auto& v){ return v.viscosity(Indices::gPhaseIdx); },"ViscosG");
+        v.viscosity(FluidSystem::wPhaseIdx); },"ViscosW");
+        vtk.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::nPhaseIdx); },"ViscosN");
+        vtk.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::gPhaseIdx); },"ViscosG");
 
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
                 vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },
                                       "x^" + FluidSystem::phaseName(i) + "_" +  FluidSystem::componentName(j));
 
diff --git a/dumux/porousmediumflow/co2/model.hh b/dumux/porousmediumflow/co2/model.hh
index 3e1be29fa3c67f5f608cccb4d663f72bb5b55911..6bd8c0c8c8de32fe9928a9aae86e0ebefcb6188a 100644
--- a/dumux/porousmediumflow/co2/model.hh
+++ b/dumux/porousmediumflow/co2/model.hh
@@ -49,16 +49,64 @@
  *
  */
 namespace Dumux {
+
+/*!
+ * \ingroup CO2Model
+ * \brief Traits class for the two-phase two-component CO2 model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct TwoPTwoCCO2VolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
+};
+
 namespace Properties {
 
 NEW_TYPE_TAG(TwoPTwoCCO2, INHERITS_FROM(TwoPTwoC));
 NEW_TYPE_TAG(TwoPTwoCCO2NI, INHERITS_FROM(TwoPTwoCNI));
 
 //! the CO2 privarswitch and VolumeVariables properties
-SET_TYPE_PROP(TwoPTwoCCO2, PrimaryVariableSwitch, TwoPTwoCCO2PrimaryVariableSwitch<TypeTag>);
-SET_TYPE_PROP(TwoPTwoCCO2NI, PrimaryVariableSwitch, TwoPTwoCCO2PrimaryVariableSwitch<TypeTag>);
-SET_TYPE_PROP(TwoPTwoCCO2, VolumeVariables, TwoPTwoCCO2VolumeVariables<TypeTag>);
-SET_TYPE_PROP(TwoPTwoCCO2NI, VolumeVariables, TwoPTwoCCO2VolumeVariables<TypeTag>);
+SET_TYPE_PROP(TwoPTwoCCO2, PrimaryVariableSwitch, TwoPTwoCCO2PrimaryVariableSwitch);
+SET_TYPE_PROP(TwoPTwoCCO2NI, PrimaryVariableSwitch, TwoPTwoCCO2PrimaryVariableSwitch);
+
+//! the co2 volume variables use the same traits as the 2p2c model
+SET_PROP(TwoPTwoCCO2, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = TwoPTwoCCO2VolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = TwoPTwoCCO2VolumeVariables< Traits >;
+};
+
+SET_PROP(TwoPTwoCCO2NI, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = TwoPTwoCCO2VolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = TwoPTwoCCO2VolumeVariables< Traits >;
+};
 
 } // end namespace Properties
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/co2/primaryvariableswitch.hh b/dumux/porousmediumflow/co2/primaryvariableswitch.hh
index eb1745fc26e5765baee35cfd31bfaebf86f8fc1c..30307aea246227596220e506a145ea06f7412f14 100644
--- a/dumux/porousmediumflow/co2/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/co2/primaryvariableswitch.hh
@@ -25,7 +25,7 @@
 #define DUMUX_2P2C_CO2_PRIMARY_VARIABLE_SWITCH_HH
 
 #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh>
-#include <dumux/porousmediumflow/2p2c/indices.hh> // for formulation
+#include <dumux/porousmediumflow/2p/formulation.hh>
 
 namespace Dumux
 {
@@ -36,53 +36,39 @@ namespace Dumux
  * of a component in a phase is exceeded, instead of the sum of the components in the virtual phase
  * (the phase which is not present) being greater that unity as done in the 2p2c model.
  */
-template<class TypeTag>
 class TwoPTwoCCO2PrimaryVariableSwitch
-: public PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPTwoCCO2PrimaryVariableSwitch<TypeTag>>
+: public PrimaryVariableSwitch< TwoPTwoCCO2PrimaryVariableSwitch >
 {
-    using ParentType = PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), TwoPTwoCCO2PrimaryVariableSwitch<TypeTag>>;
+    using ParentType = PrimaryVariableSwitch< TwoPTwoCCO2PrimaryVariableSwitch >;
     friend ParentType;
 
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum {
-        switchIdx = Indices::switchIdx,
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
-
-        wPhaseOnly = Indices::wPhaseOnly,
-        nPhaseOnly = Indices::nPhaseOnly,
-        bothPhases = Indices::bothPhases,
-
-        pwsn = TwoPTwoCFormulation::pwsn,
-        pnsw = TwoPTwoCFormulation::pnsw,
-        formulation = GET_PROP_VALUE(TypeTag, Formulation)
-    };
-
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-
 public:
     using ParentType::ParentType;
 
 protected:
-
     // perform variable switch at a degree of freedom location
-    bool update_(PrimaryVariables& priVars,
+    template<class VolumeVariables, class IndexType, class GlobalPosition>
+    bool update_(typename VolumeVariables::PrimaryVariables& priVars,
                  const VolumeVariables& volVars,
                  IndexType dofIdxGlobal,
                  const GlobalPosition& globalPos)
     {
+        using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
+
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        static constexpr int phase0Idx = FluidSystem::phase0Idx;
+        static constexpr int phase1Idx = FluidSystem::phase1Idx;
+        static constexpr int comp0Idx = FluidSystem::comp0Idx;
+        static constexpr int comp1Idx = FluidSystem::comp1Idx;
+
+        static constexpr bool useMoles = VolumeVariables::useMoles();
+        static constexpr auto formulation = VolumeVariables::priVarFormulation();
+        static_assert( (formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0),
+                        "Chosen TwoPFormulation not supported!");
+
+        using Indices = typename VolumeVariables::Indices;
+        static constexpr int switchIdx = Indices::switchIdx;
+
         // evaluate primary variable switch
         bool wouldSwitch = false;
         int phasePresence = priVars.state();
@@ -92,11 +78,11 @@ protected:
         typename FluidSystem::ParameterCache paramCache;
 
         // check if a primary var switch is necessary
-        if (phasePresence == nPhaseOnly)
+        if (phasePresence == Indices::secondPhaseOnly)
         {
-            // calculate wetting component mole fraction in the non-wetting phase
-            Scalar xnw = volVars.moleFraction(nPhaseIdx, wCompIdx);
-            Scalar xnwMax = FluidSystem::equilibriumMoleFraction(volVars.fluidState(), paramCache, nPhaseIdx);
+            // calculate wetting component mole fraction in the second phase
+            Scalar xnw = volVars.moleFraction(phase1Idx, comp0Idx);
+            Scalar xnwMax = FluidSystem::equilibriumMoleFraction(volVars.fluidState(), paramCache, phase1Idx);
 
             // if it is larger than the equilibirum mole fraction switch
             if(xnw > xnwMax)
@@ -105,25 +91,25 @@ protected:
             if (this->wasSwitched_[dofIdxGlobal])
                 xnwMax *= 1.02;
 
-            // if it is larger than the equilibirum mole fraction switch wetting phase appears
+            // if it is larger than the equilibirum mole fraction switch: first phase appears
             if (xnw > xnwMax)
             {
                 // wetting phase appears
-                std::cout << "wetting phase appears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", xnw > xnwMax: "
+                std::cout << "First phase appears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", x10 > x10_max: "
                           << xnw << " > " << xnwMax << std::endl;
-                newPhasePresence = bothPhases;
-                if (formulation == pnsw)
+                newPhasePresence = Indices::bothPhases;
+                if (formulation == TwoPFormulation::p1s0)
                     priVars[switchIdx] = 0.0;
-                else if (formulation == pwsn)
+                else
                     priVars[switchIdx] = 1.0;
             }
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == Indices::firstPhaseOnly)
         {
-            // calculate non-wetting component mole fraction in the wetting phase
-            Scalar xwn = volVars.moleFraction(wPhaseIdx, nCompIdx);
-            Scalar xwnMax = FluidSystem::equilibriumMoleFraction(volVars.fluidState(), paramCache, wPhaseIdx);
+            // calculate second component mole fraction in the wetting phase
+            Scalar xwn = volVars.moleFraction(phase0Idx, comp1Idx);
+            Scalar xwnMax = FluidSystem::equilibriumMoleFraction(volVars.fluidState(), paramCache, phase0Idx);
 
             // if it is larger than the equilibirum mole fraction switch
             if(xwn > xwnMax)
@@ -132,66 +118,54 @@ protected:
             if (this->wasSwitched_[dofIdxGlobal])
                 xwnMax *= 1.02;
 
-            // if it is larger than the equilibirum mole fraction switch non-wetting phase appears
+            // if it is larger than the equilibirum mole fraction switch second phase appears
             if(xwn > xwnMax)
             {
-                // nonwetting phase appears
-                std::cout << "nonwetting phase appears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", xwn > xwnMax: "
+                // Second phase appears
+                std::cout << "Second phase appears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", x01 > x01_max: "
                           << xwn << " > " << xwnMax << std::endl;
-                newPhasePresence = bothPhases;
-                if (formulation == pnsw)
+                newPhasePresence = Indices::bothPhases;
+                if (formulation == TwoPFormulation::p1s0)
                     priVars[switchIdx] = 0.999;
-                else if (formulation == pwsn)
+                else
                     priVars[switchIdx] = 0.001;
             }
         }
         // TODO: this is the same as for the 2p2c model maybe factor out
-        else if (phasePresence == bothPhases)
+        else if (phasePresence == Indices::bothPhases)
         {
             Scalar Smin = 0.0;
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(nPhaseIdx) <= Smin)
+            if (volVars.saturation(phase1Idx) <= Smin)
             {
                 wouldSwitch = true;
                 // nonwetting phase disappears
-                std::cout << "Nonwetting phase disappears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", sn: "
-                          << volVars.saturation(nPhaseIdx) << std::endl;
-                newPhasePresence = wPhaseOnly;
+                std::cout << "Second phase disappears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", s1: "
+                          << volVars.saturation(phase1Idx) << std::endl;
+                newPhasePresence = Indices::firstPhaseOnly;
 
                 if(useMoles) // mole-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.moleFraction(wPhaseIdx, nCompIdx);
-                }
+                    priVars[switchIdx] = volVars.moleFraction(phase0Idx, comp1Idx);
                 else // mass-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.massFraction(wPhaseIdx, nCompIdx);
-                }
+                    priVars[switchIdx] = volVars.massFraction(phase0Idx, comp1Idx);
             }
-            else if (volVars.saturation(wPhaseIdx) <= Smin)
+            else if (volVars.saturation(phase0Idx) <= Smin)
             {
                 wouldSwitch = true;
                 // wetting phase disappears
-                std::cout << "Wetting phase disappears at vertex " << dofIdxGlobal
-                          << ", coordinates: " << globalPos << ", sw: "
-                          << volVars.saturation(wPhaseIdx) << std::endl;
-                newPhasePresence = nPhaseOnly;
+                std::cout << "First phase disappears at vertex " << dofIdxGlobal
+                          << ", coordinates: " << globalPos << ", s0: "
+                          << volVars.saturation(phase0Idx) << std::endl;
+                newPhasePresence = Indices::secondPhaseOnly;
 
                 if(useMoles) // mole-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.moleFraction(nPhaseIdx, wCompIdx);
-                }
+                    priVars[switchIdx] = volVars.moleFraction(phase1Idx, comp0Idx);
                 else // mass-fraction formulation
-                {
-                    priVars[switchIdx]
-                        = volVars.massFraction(nPhaseIdx, wCompIdx);
-                }
+                    priVars[switchIdx] = volVars.massFraction(phase1Idx, comp0Idx);
             }
         }
 
diff --git a/dumux/porousmediumflow/co2/volumevariables.hh b/dumux/porousmediumflow/co2/volumevariables.hh
index b193b4659c2be37c808412a72fe0aa8b8a6301d3..e53dfe04bc471704d143b7226258174987f60121 100644
--- a/dumux/porousmediumflow/co2/volumevariables.hh
+++ b/dumux/porousmediumflow/co2/volumevariables.hh
@@ -26,7 +26,7 @@
 #define DUMUX_CO2_VOLUME_VARIABLES_HH
 
 #include <dumux/common/properties.hh>
-#include <dumux/porousmediumflow/2p2c/volumevariables.hh>
+#include <dumux/porousmediumflow/2p/formulation.hh>
 
 namespace Dumux {
 
@@ -35,107 +35,172 @@ namespace Dumux {
  * \brief Contains the quantities which are are constant within a
  *        finite volume in the CO2 model.
  */
-template <class TypeTag>
-class TwoPTwoCCO2VolumeVariables : public TwoPTwoCVolumeVariables<TypeTag>
+template <class Traits>
+class TwoPTwoCCO2VolumeVariables
+: public PorousMediumFlowVolumeVariables< Traits, TwoPTwoCCO2VolumeVariables<Traits> >
 {
-    using ParentType = TwoPTwoCVolumeVariables<TypeTag>;
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity;
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() };
-
-    enum {
-        wCompIdx = Indices::wCompIdx,
-        nCompIdx = Indices::nCompIdx,
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx
-    };
+    using ParentType = PorousMediumFlowVolumeVariables< Traits, TwoPTwoCCO2VolumeVariables<Traits> >;
+
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using ModelTraits = typename Traits::ModelTraits;
 
-    // present phases
-    enum {
-        wPhaseOnly = Indices::wPhaseOnly,
-        nPhaseOnly = Indices::nPhaseOnly,
-        bothPhases = Indices::bothPhases
+    // component indices
+    enum
+    {
+        comp0Idx = Traits::FluidSystem::comp0Idx,
+        comp1Idx = Traits::FluidSystem::comp1Idx,
+        phase0Idx = Traits::FluidSystem::phase0Idx,
+        phase1Idx = Traits::FluidSystem::phase1Idx
     };
 
-    // formulations
-    enum {
-        formulation = GET_PROP_VALUE(TypeTag, Formulation),
-        pwsn = TwoPTwoCFormulation::pwsn,
-        pnsw = TwoPTwoCFormulation::pnsw
+    // phase presence indices
+    enum
+    {
+        firstPhaseOnly = ModelTraits::Indices::firstPhaseOnly,
+        secondPhaseOnly = ModelTraits::Indices::secondPhaseOnly,
+        bothPhases = ModelTraits::Indices::bothPhases
     };
 
     // primary variable indices
-    enum {
-        switchIdx = Indices::switchIdx,
-        pressureIdx = Indices::pressureIdx
+    enum
+    {
+        switchIdx = ModelTraits::Indices::switchIdx,
+        pressureIdx = ModelTraits::Indices::pressureIdx
     };
 
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    // formulation
+    static constexpr auto formulation = ModelTraits::priVarFormulation();
 
+    // type used for the permeability
+    using PermeabilityType = typename Traits::PermeabilityType;
 public:
     //! The type of the object returned by the fluidState() method
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-
-    //! TODO: This is a lot of copy paste from the 2p2c: factor out code!
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
-                                   const Problem& problem,
-                                   const Element& element,
-                                   const SubControlVolume& scv,
-                                   FluidState& fluidState)
+    using FluidState = typename Traits::FluidState;
+    //! The fluid system used here
+    using FluidSystem = typename Traits::FluidSystem;
+
+    //! return whether moles or masses are balanced
+    static constexpr bool useMoles() { return ModelTraits::useMoles(); }
+    //! return the two-phase formulation used here
+    static constexpr TwoPFormulation priVarFormulation() { return formulation; }
+
+    // check for permissive combinations
+    static_assert(ModelTraits::numPhases() == 2, "NumPhases set in the model is not two!");
+    static_assert(ModelTraits::numComponents() == 2, "NumComponents set in the model is not two!");
+    static_assert((formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!");
+
+    /*!
+     * \brief Update all quantities for a given control volume
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param problem The object specifying the problem which ought to
+     *                be simulated
+     * \param element An element which contains part of the control volume
+     * \param scv The sub control volume
+    */
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol& elemSol, const Problem& problem, const Element& element, const Scv& scv)
     {
+        ParentType::update(elemSol, problem, element, scv);
+        completeFluidState(elemSol, problem, element, scv, fluidState_);
+
+        // Second instance of a parameter cache. Could be avoided if
+        // diffusion coefficients also became part of the fluid state.
+        typename FluidSystem::ParameterCache paramCache;
+        paramCache.updateAll(fluidState_);
+
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
+        const auto& matParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
+
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        const int nPhaseIdx = 1 - wPhaseIdx;
+
+        // relative permeabilities -> require wetting phase saturation as parameter!
+        relativePermeability_[wPhaseIdx] = MaterialLaw::krw(matParams, saturation(wPhaseIdx));
+        relativePermeability_[nPhaseIdx] = MaterialLaw::krn(matParams, saturation(wPhaseIdx));
 
-        const Scalar t = ParentType::temperature(elemSol, problem, element, scv);
+        // binary diffusion coefficients
+        diffCoeff_[phase0Idx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phase0Idx, comp0Idx, comp1Idx);
+        diffCoeff_[phase1Idx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phase1Idx, comp0Idx, comp1Idx);
+
+        // porosity & permeabilty
+        porosity_ = problem.spatialParams().porosity(element, scv, elemSol);
+        permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
+    }
+
+    /*!
+     * \brief Complete the fluid state
+     * \note TODO: This is a lot of copy paste from the 2p2c: factor out code!
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param problem The problem
+     * \param element The element
+     * \param scv The sub control volume
+     * \param fluidState The fluid state
+     *
+     * Set temperature, saturations, capillary pressures, viscosities, densities and enthalpies.
+     */
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void completeFluidState(const ElemSol& elemSol,
+                            const Problem& problem,
+                            const Element& element,
+                            const Scv& scv,
+                            FluidState& fluidState)
+    {
+        const auto t = ParentType::temperature(elemSol, problem, element, scv);
         fluidState.setTemperature(t);
 
         const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
         const auto phasePresence = priVars.state();
 
-        /////////////
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
+        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
+        const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
+        fluidState.setWettingPhase(wPhaseIdx);
+
         // set the saturations
-        /////////////
-        Scalar sn;
-        if (phasePresence == nPhaseOnly)
-            sn = 1.0;
-        else if (phasePresence == wPhaseOnly) {
-            sn = 0.0;
+        if (phasePresence == secondPhaseOnly)
+        {
+            fluidState.setSaturation(phase0Idx, 0.0);
+            fluidState.setSaturation(phase1Idx, 1.0);
         }
-        else if (phasePresence == bothPhases) {
-            if (formulation == pwsn)
-                sn = priVars[switchIdx];
-            else if (formulation == pnsw)
-                sn = 1.0 - priVars[switchIdx];
-            else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << formulation << " is invalid.");
+        else if (phasePresence == firstPhaseOnly)
+        {
+            fluidState.setSaturation(phase0Idx, 1.0);
+            fluidState.setSaturation(phase1Idx, 0.0);
         }
-        else DUNE_THROW(Dune::InvalidStateException, "phasePresence: " << phasePresence << " is invalid.");
-        fluidState.setSaturation(wPhaseIdx, 1 - sn);
-        fluidState.setSaturation(nPhaseIdx, sn);
-
-        // capillary pressure parameters
-        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
-        Scalar pc = MaterialLaw::pc(materialParams, 1 - sn);
+        else if (phasePresence == bothPhases)
+        {
+            if (formulation == TwoPFormulation::p0s1)
+            {
+                fluidState.setSaturation(phase1Idx, priVars[switchIdx]);
+                fluidState.setSaturation(phase0Idx, 1 - priVars[switchIdx]);
+            }
+            else
+            {
+                fluidState.setSaturation(phase0Idx, priVars[switchIdx]);
+                fluidState.setSaturation(phase1Idx, 1 - priVars[switchIdx]);
+            }
+        }
+        else
+            DUNE_THROW(Dune::InvalidStateException, "Invalid phase presence.");
 
-        if (formulation == pwsn) {
-            fluidState.setPressure(wPhaseIdx, priVars[pressureIdx]);
-            fluidState.setPressure(nPhaseIdx, priVars[pressureIdx] + pc);
+        // set pressures of the fluid phases
+        pc_ = MaterialLaw::pc(materialParams, fluidState.saturation(wPhaseIdx));
+        if (formulation == TwoPFormulation::p0s1)
+        {
+            fluidState.setPressure(phase0Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase1Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] + pc_
+                                                                       : priVars[pressureIdx] - pc_);
         }
-        else if (formulation == pnsw) {
-            fluidState.setPressure(nPhaseIdx, priVars[pressureIdx]);
-            fluidState.setPressure(wPhaseIdx, priVars[pressureIdx] - pc);
+        else
+        {
+            fluidState.setPressure(phase1Idx, priVars[pressureIdx]);
+            fluidState.setPressure(phase0Idx, (wPhaseIdx == phase0Idx) ? priVars[pressureIdx] - pc_
+                                                                       : priVars[pressureIdx] + pc_);
         }
-        else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << formulation << " is invalid.");
 
-        /////////////
         // calculate the phase compositions
-        /////////////
         typename FluidSystem::ParameterCache paramCache;
         // both phases are present
         if (phasePresence == bothPhases)
@@ -143,71 +208,71 @@ public:
             //Get the equilibrium mole fractions from the FluidSystem and set them in the fluidState
             //xCO2 = equilibrium mole fraction of CO2 in the liquid phase
             //yH2O = equilibrium mole fraction of H2O in the gas phase
-            const auto xwCO2 = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, wPhaseIdx);
-            const auto xgH2O = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, nPhaseIdx);
+            const auto xwCO2 = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, phase0Idx);
+            const auto xgH2O = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, phase1Idx);
             const auto xwH2O = 1 - xwCO2;
             const auto xgCO2 = 1 - xgH2O;
-            fluidState.setMoleFraction(wPhaseIdx, wCompIdx, xwH2O);
-            fluidState.setMoleFraction(wPhaseIdx, nCompIdx, xwCO2);
-            fluidState.setMoleFraction(nPhaseIdx, wCompIdx, xgH2O);
-            fluidState.setMoleFraction(nPhaseIdx, nCompIdx, xgCO2);
+            fluidState.setMoleFraction(phase0Idx, comp0Idx, xwH2O);
+            fluidState.setMoleFraction(phase0Idx, comp1Idx, xwCO2);
+            fluidState.setMoleFraction(phase1Idx, comp0Idx, xgH2O);
+            fluidState.setMoleFraction(phase1Idx, comp1Idx, xgCO2);
         }
 
         // only the nonwetting phase is present, i.e. nonwetting phase
         // composition is stored explicitly.
-        else if (phasePresence == nPhaseOnly)
+        else if (phasePresence == secondPhaseOnly)
         {
-            if(useMoles) // mole-fraction formulation
+            if( useMoles() ) // mole-fraction formulation
             {
                 // set the fluid state
-                fluidState.setMoleFraction(nPhaseIdx, wCompIdx, priVars[switchIdx]);
-                fluidState.setMoleFraction(nPhaseIdx, nCompIdx, 1-priVars[switchIdx]);
+                fluidState.setMoleFraction(phase1Idx, comp0Idx, priVars[switchIdx]);
+                fluidState.setMoleFraction(phase1Idx, comp1Idx, 1-priVars[switchIdx]);
                 // TODO give values for non-existing wetting phase
-                const auto xwCO2 = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, wPhaseIdx);
+                const auto xwCO2 = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, phase0Idx);
                 const auto xwH2O = 1 - xwCO2;
-                fluidState.setMoleFraction(wPhaseIdx, nCompIdx, xwCO2);
-                fluidState.setMoleFraction(wPhaseIdx, wCompIdx, xwH2O);
+                fluidState.setMoleFraction(phase0Idx, comp1Idx, xwCO2);
+                fluidState.setMoleFraction(phase0Idx, comp0Idx, xwH2O);
             }
             else // mass-fraction formulation
             {
                 // setMassFraction() has only to be called 1-numComponents times
-                fluidState.setMassFraction(nPhaseIdx, wCompIdx, priVars[switchIdx]);
+                fluidState.setMassFraction(phase1Idx, comp0Idx, priVars[switchIdx]);
                 // TODO give values for non-existing wetting phase
-                const auto xwCO2 = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, wPhaseIdx);
+                const auto xwCO2 = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, phase0Idx);
                 const auto xwH2O = 1 - xwCO2;
-                fluidState.setMoleFraction(wPhaseIdx, nCompIdx, xwCO2);
-                fluidState.setMoleFraction(wPhaseIdx, wCompIdx, xwH2O);
+                fluidState.setMoleFraction(phase0Idx, comp1Idx, xwCO2);
+                fluidState.setMoleFraction(phase0Idx, comp0Idx, xwH2O);
             }
         }
 
         // only the wetting phase is present, i.e. wetting phase
         // composition is stored explicitly.
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == firstPhaseOnly)
         {
-            if(useMoles) // mole-fraction formulation
+            if( useMoles() ) // mole-fraction formulation
             {
                 // convert mass to mole fractions and set the fluid state
-                fluidState.setMoleFraction(wPhaseIdx, wCompIdx, 1-priVars[switchIdx]);
-                fluidState.setMoleFraction(wPhaseIdx, nCompIdx, priVars[switchIdx]);
+                fluidState.setMoleFraction(phase0Idx, comp0Idx, 1-priVars[switchIdx]);
+                fluidState.setMoleFraction(phase0Idx, comp1Idx, priVars[switchIdx]);
                 //  TODO give values for non-existing nonwetting phase
-                Scalar xnH2O = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, nPhaseIdx);
+                Scalar xnH2O = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, phase1Idx);
                 Scalar xnCO2 = 1 - xnH2O;
-                fluidState.setMoleFraction(nPhaseIdx, nCompIdx, xnCO2);
-                fluidState.setMoleFraction(nPhaseIdx, wCompIdx, xnH2O);
+                fluidState.setMoleFraction(phase1Idx, comp1Idx, xnCO2);
+                fluidState.setMoleFraction(phase1Idx, comp0Idx, xnH2O);
             }
             else // mass-fraction formulation
             {
                 // setMassFraction() has only to be called 1-numComponents times
-                fluidState.setMassFraction(wPhaseIdx, nCompIdx, priVars[switchIdx]);
+                fluidState.setMassFraction(phase0Idx, comp1Idx, priVars[switchIdx]);
                 //  TODO give values for non-existing nonwetting phase
-                Scalar xnH2O = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, nPhaseIdx);
+                Scalar xnH2O = FluidSystem::equilibriumMoleFraction(fluidState, paramCache, phase1Idx);
                 Scalar xnCO2 = 1 - xnH2O;
-                fluidState.setMoleFraction(nPhaseIdx, nCompIdx, xnCO2);
-                fluidState.setMoleFraction(nPhaseIdx, wCompIdx, xnH2O);
+                fluidState.setMoleFraction(phase1Idx, comp1Idx, xnCO2);
+                fluidState.setMoleFraction(phase1Idx, comp0Idx, xnH2O);
             }
         }
 
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+        for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx)
         {
             // set the viscosity and desity here if constraintsolver is not used
             paramCache.updateComposition(fluidState, phaseIdx);
@@ -221,6 +286,147 @@ public:
             fluidState.setEnthalpy(phaseIdx, h);
         }
     }
+
+    /*!
+     * \brief Returns the phase state within the control volume.
+     */
+    const FluidState &fluidState() const
+    { return fluidState_; }
+
+    /*!
+     * \brief Returns the saturation of a given phase within
+     *        the control volume in \f$[-]\f$.
+     *
+     * \param phaseIdx The phase index
+     */
+    Scalar saturation(const int phaseIdx) const
+    { return fluidState_.saturation(phaseIdx); }
+
+    /*!
+     * \brief Returns the mass fraction of a given component in a
+     *        given phase within the control volume in \f$[-]\f$.
+     *
+     * \param phaseIdx The phase index
+     * \param compIdx The component index
+     */
+    Scalar massFraction(const int phaseIdx, const int compIdx) const
+    { return fluidState_.massFraction(phaseIdx, compIdx); }
+
+    /*!
+     * \brief Returns the mole fraction of a given component in a
+     *        given phase within the control volume in \f$[-]\f$.
+     *
+     * \param phaseIdx The phase index
+     * \param compIdx The component index
+     */
+    Scalar moleFraction(const int phaseIdx, const int compIdx) const
+    { return fluidState_.moleFraction(phaseIdx, compIdx); }
+
+    /*!
+     * \brief Returns the mass density of a given phase within the
+     *        control volume in \f$[kg/m^3]\f$.
+     *
+     * \param phaseIdx The phase index
+     */
+    Scalar density(const int phaseIdx) const
+    { return fluidState_.density(phaseIdx); }
+
+    /*!
+     * \brief Returns the dynamic viscosity of the fluid within the
+     *        control volume in \f$\mathrm{[Pa s]}\f$.
+     *
+     * \param phaseIdx The phase index
+     */
+    Scalar viscosity(const int phaseIdx) const
+    { return fluidState_.viscosity(phaseIdx); }
+
+    /*!
+     * \brief Returns the mass density of a given phase within the
+     *        control volume in \f$[mol/m^3]\f$.
+     *
+     * \param phaseIdx The phase index
+     */
+    Scalar molarDensity(const int phaseIdx) const
+    { return fluidState_.density(phaseIdx) / fluidState_.averageMolarMass(phaseIdx); }
+
+    /*!
+     * \brief Returns the effective pressure of a given phase within
+     *        the control volume in \f$[kg/(m*s^2)=N/m^2=Pa]\f$.
+     *
+     * \param phaseIdx The phase index
+     */
+    Scalar pressure(const int phaseIdx) const
+    { return fluidState_.pressure(phaseIdx); }
+
+    /*!
+     * \brief Returns temperature within the control volume in \f$[K]\f$.
+     *
+     * Note that we assume thermodynamic equilibrium, i.e. the
+     * temperature of the rock matrix and of all fluid phases are
+     * identical.
+     */
+    Scalar temperature() const
+    { return fluidState_.temperature(/*phaseIdx=*/0); }
+
+    /*!
+     * \brief Returns the relative permeability of a given phase within
+     *        the control volume in \f$[-]\f$.
+     *
+     * \param phaseIdx The phase index
+     */
+    Scalar relativePermeability(const int phaseIdx) const
+    { return relativePermeability_[phaseIdx]; }
+
+    /*!
+     * \brief Returns the effective mobility of a given phase within
+     *        the control volume in \f$[s*m/kg]\f$.
+     *
+     * \param phaseIdx The phase index
+     */
+    Scalar mobility(const int phaseIdx) const
+    { return relativePermeability_[phaseIdx]/fluidState_.viscosity(phaseIdx); }
+
+    /*!
+     * \brief Returns the effective capillary pressure within the control volume
+     *        in \f$[kg/(m*s^2)=N/m^2=Pa]\f$.
+     */
+    Scalar capillaryPressure() const
+    { return fluidState_.pressure(phase1Idx) - fluidState_.pressure(phase0Idx); }
+
+    /*!
+     * \brief Returns the average porosity within the control volume in \f$[-]\f$.
+     */
+    Scalar porosity() const
+    { return porosity_; }
+
+    /*!
+     * \brief Returns the average permeability within the control volume in \f$[m^2]\f$.
+     */
+    const PermeabilityType& permeability() const
+    { return permeability_; }
+
+    /*!
+     * \brief Returns the binary diffusion coefficients for a phase in \f$[m^2/s]\f$.
+     */
+    Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
+    {
+        if(phaseIdx == compIdx)
+            DUNE_THROW(Dune::InvalidStateException, "Diffusion coefficient called for phaseIdx = compIdx");
+        else
+            return diffCoeff_[phaseIdx];
+    }
+
+private:
+    FluidState fluidState_;
+    Scalar pc_;                     //!< The capillary pressure
+    Scalar porosity_;               //!< Effective porosity within the control volume
+    PermeabilityType permeability_; //!< Effective permeability within the control volume
+
+    //!< Relative permeability within the control volume
+    std::array<Scalar, ModelTraits::numPhases()> relativePermeability_;
+
+    //!< Binary diffusion coefficients for the phases
+    std::array<Scalar, ModelTraits::numPhases()> diffCoeff_;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/compositional/localresidual.hh b/dumux/porousmediumflow/compositional/localresidual.hh
index 70013c544bacc046f748a1812a32f2844c3d32c7..eb93c55bebf257128e00882a1fe9709e0beebb11 100644
--- a/dumux/porousmediumflow/compositional/localresidual.hh
+++ b/dumux/porousmediumflow/compositional/localresidual.hh
@@ -48,7 +48,6 @@ class CompositionalLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidua
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
@@ -56,6 +55,7 @@ class CompositionalLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidua
     using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
     static constexpr int numPhases = ModelTraits::numPhases();
     static constexpr int numComponents = ModelTraits::numComponents();
diff --git a/dumux/porousmediumflow/compositional/primaryvariableswitch.hh b/dumux/porousmediumflow/compositional/primaryvariableswitch.hh
index 777eb6bc28a9170a6e9a297cc58e06bdc92784c0..39ef5fda73b4bc5f64b6acfac89807b0d3c506c8 100644
--- a/dumux/porousmediumflow/compositional/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/compositional/primaryvariableswitch.hh
@@ -48,29 +48,17 @@ public:
  * \ingroup PorousmediumCompositional
  * \brief The primary variable switch controlling the phase presence state variable
  */
-template<class FVGridGeometry, class Implementation>
+template<class Implementation>
 class PrimaryVariableSwitch
 {
-    using FVElementGeometry = typename FVGridGeometry::LocalView;
-    using SubControlVolume = typename FVGridGeometry::SubControlVolume;
-
-    using GridView = typename FVGridGeometry::GridView;
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using GlobalPosition = Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>;
-    using Element = typename GridView::template Codim<0>::Entity;
-
-    static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
-    enum { dim = GridView::dimension };
-
 public:
-
     PrimaryVariableSwitch(const std::size_t& numDofs)
     {
         wasSwitched_.resize(numDofs, false);
     }
 
     //! If the primary variables were recently switched
-    bool wasSwitched(IndexType dofIdxGlobal) const
+    bool wasSwitched(std::size_t dofIdxGlobal) const
     {
         return wasSwitched_[dofIdxGlobal];
     }
@@ -87,7 +75,7 @@ public:
     bool update(SolutionVector& curSol,
                 GridVariables& gridVariables,
                 const Problem& problem,
-                const FVGridGeometry& fvGridGeometry)
+                const typename GridVariables::GridGeometry& fvGridGeometry)
     {
         bool switched = false;
         visited_.assign(wasSwitched_.size(), false);
@@ -140,10 +128,10 @@ protected:
     { return *static_cast<const Implementation*>(this); }
 
     // perform variable switch at a degree of freedom location
-    template<class PrimaryVariables, class VolumeVariables>
-    bool update_(PrimaryVariables& priVars,
+    template<class VolumeVariables, class GlobalPosition>
+    bool update_(typename VolumeVariables::PrimaryVariables& priVars,
                  const VolumeVariables& volVars,
-                 IndexType dofIdxGlobal,
+                 std::size_t dofIdxGlobal,
                  const GlobalPosition& globalPos)
     {
         // evaluate if the primary variable switch would switch
@@ -155,12 +143,12 @@ protected:
     std::vector<bool> visited_;
 
 private:
-    template<class GridVolumeVariables, class ElementVolumeVariables>
+    template<class GridVolumeVariables, class ElementVolumeVariables, class SubControlVolume>
     static auto getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv)
     -> std::enable_if_t<!GridVolumeVariables::cachingEnabled, decltype(elemVolVars[scv])>
     { return elemVolVars[scv]; }
 
-    template<class GridVolumeVariables, class ElementVolumeVariables>
+    template<class GridVolumeVariables, class ElementVolumeVariables, class SubControlVolume>
     static auto getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv)
     -> std::enable_if_t<GridVolumeVariables::cachingEnabled, decltype(gridVolVars.volVars(scv))>
     { return gridVolVars.volVars(scv); }
diff --git a/dumux/porousmediumflow/immiscible/localresidual.hh b/dumux/porousmediumflow/immiscible/localresidual.hh
index fc81af5500baa86d10cf6f92deefcbc7b732eeb5..d48dd4011bbcc1a588cc4f03eedd98201d51f2b7 100644
--- a/dumux/porousmediumflow/immiscible/localresidual.hh
+++ b/dumux/porousmediumflow/immiscible/localresidual.hh
@@ -51,11 +51,10 @@ class ImmiscibleLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    // first index for the mass balance
-    enum { conti0EqIdx = Indices::conti0EqIdx };
 
-    static const int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases();
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    static constexpr int numPhases = ModelTraits::numPhases();
+    static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx; //!< first index for the mass balance
 
 public:
     using ParentType::ParentType;
diff --git a/dumux/porousmediumflow/mineralization/localresidual.hh b/dumux/porousmediumflow/mineralization/localresidual.hh
index f99d8af5a731a12d274607a2d47b9ae8d4f70927..4585b1106afbb3736f589db3bf1025cdb9e663f7 100644
--- a/dumux/porousmediumflow/mineralization/localresidual.hh
+++ b/dumux/porousmediumflow/mineralization/localresidual.hh
@@ -42,7 +42,7 @@ class MineralizationLocalResidual: public CompositionalLocalResidual<TypeTag>
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
 
diff --git a/dumux/porousmediumflow/mineralization/volumevariables.hh b/dumux/porousmediumflow/mineralization/volumevariables.hh
index 0ebc313d74e8faa3577ecb000e84eca25265085f..1855d728961dedc0f39e7e9c25dc6c12522adc5a 100644
--- a/dumux/porousmediumflow/mineralization/volumevariables.hh
+++ b/dumux/porousmediumflow/mineralization/volumevariables.hh
@@ -25,10 +25,6 @@
 #ifndef DUMUX_MINERALIZATION_VOLUME_VARIABLES_HH
 #define DUMUX_MINERALIZATION_VOLUME_VARIABLES_HH
 
-#include <dumux/common/math.hh>
-#include <dumux/common/properties.hh>
-#include <dumux/material/fluidstates/compositional.hh>
-
 namespace Dumux {
 
 /*!
@@ -36,34 +32,25 @@ namespace Dumux {
  * \brief Contains the quantities which are are constant within a sub-control volume
  *        of the finite volume grid in an m-phase, n-component, mineralization model.
  */
-template <class TypeTag, class NonMineralizationVolVars>
+template <class Traits, class NonMineralizationVolVars>
 class MineralizationVolumeVariables : public NonMineralizationVolVars
 {
     using ParentType = NonMineralizationVolVars;
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Element = typename GridView::template Codim<0>::Entity;
-    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
-    enum
-    {
-        numPhases = ModelTraits::numPhases(),
-        numSPhases =  ModelTraits::numSPhases(),
-        numComponents = ModelTraits::numComponents()
-    };
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using ModelTraits = typename Traits::ModelTraits;
 
 public:
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    //! export the type of the fluid state
+    using FluidState = typename Traits::FluidState;
+    //! export the type of the fluid system
+    using FluidSystem = typename Traits::FluidSystem;
 
     //! updates all required quantities inside the given scv
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         // Update parent type (also completes the fluid state)
         ParentType::update(elemSol, problem, element, scv);
@@ -72,9 +59,9 @@ public:
         auto&& priVars = elemSol[scv.indexInElement()];
 
         sumPrecipitates_ = 0.0;
-        for(int sPhaseIdx = 0; sPhaseIdx < numSPhases; ++sPhaseIdx)
+        for(int sPhaseIdx = 0; sPhaseIdx < ModelTraits::numSPhases(); ++sPhaseIdx)
         {
-           precipitateVolumeFraction_[sPhaseIdx] = priVars[numComponents + sPhaseIdx];
+           precipitateVolumeFraction_[sPhaseIdx] = priVars[ModelTraits::numComponents() + sPhaseIdx];
            sumPrecipitates_+= precipitateVolumeFraction_[sPhaseIdx];
         }
     }
@@ -86,16 +73,17 @@ public:
      * \param phaseIdx the index of the solid phase
      */
     Scalar precipitateVolumeFraction(int phaseIdx) const
-    { return precipitateVolumeFraction_[phaseIdx - numPhases]; }
+    { return precipitateVolumeFraction_[phaseIdx - ModelTraits::numPhases()]; }
 
     /*!
      * \brief Returns the density of the phase for all fluid and solid phases
      *
      * \param phaseIdx the index of the fluid phase
+     * \todo TODO: This fails for 1pnc if fluidSystemPhaseIdx is not 0
      */
     Scalar density(int phaseIdx) const
     {
-        if (phaseIdx < numPhases)
+        if (phaseIdx < ModelTraits::numPhases())
             return this->fluidState_.density(phaseIdx);
         else
             return FluidSystem::precipitateDensity(phaseIdx);
@@ -106,10 +94,11 @@ public:
      *        control volume.
      *
      * \param phaseIdx The phase index
+     * \todo TODO: This fails for 1pnc if fluidSystemPhaseIdx is not 0
      */
     Scalar molarDensity(int phaseIdx) const
     {
-        if (phaseIdx < numPhases)
+        if (phaseIdx < ModelTraits::numPhases())
             return this->fluidState_.molarDensity(phaseIdx);
         else
             return FluidSystem::precipitateMolarDensity(phaseIdx);
@@ -135,7 +124,7 @@ public:
     }
 
 protected:
-    Scalar precipitateVolumeFraction_[numSPhases];
+    Scalar precipitateVolumeFraction_[ModelTraits::numSPhases()];
     Scalar sumPrecipitates_;
 };
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/mineralization/vtkoutputfields.hh b/dumux/porousmediumflow/mineralization/vtkoutputfields.hh
index 6bd92b7de71cafe3d9e697b1512d0435e5c68ead..79acc52d8ebc42d88e157f506f9457d66f53cc97 100644
--- a/dumux/porousmediumflow/mineralization/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/mineralization/vtkoutputfields.hh
@@ -25,30 +25,30 @@
 #ifndef DUMUX_MINERALIZATION_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_MINERALIZATION_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup MineralizationModel
  * \brief Adds vtk output fields specific to a NCMin model
  */
-template<class NonMineralizationVtkOutputFields, class FluidSystem>
+template<class NonMineralizationVtkOutputFields>
 class MineralizationVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using FluidSystem = typename VtkOutputModule::VolumeVariables::FluidSystem;
+
         // output of the model without mineralization
         NonMineralizationVtkOutputFields::init(vtk);
 
         // additional output
+        // TODO: Why does fluid system have number of solid phases??
         for (int i = 0; i < FluidSystem::numSPhases; ++i)
         {
-            vtk.addVolumeVariable([i](const auto& v){ return v.precipitateVolumeFraction(FluidSystem::numPhases + i); },"precipitateVolumeFraction_"+ FluidSystem::phaseName(FluidSystem::numPhases + i));
+            vtk.addVolumeVariable([i](const auto& v){ return v.precipitateVolumeFraction(FluidSystem::numPhases + i); },
+                                  "precipitateVolumeFraction_"+ FluidSystem::phaseName(FluidSystem::numPhases + i));
         }
     }
 };
diff --git a/dumux/porousmediumflow/mpnc/indices.hh b/dumux/porousmediumflow/mpnc/indices.hh
index 994e85a0a48585f98b4e0c5a2ae3d6b324a89ab3..0ba69151fa6a405cb897ace16831bd0cccfc60d5 100644
--- a/dumux/porousmediumflow/mpnc/indices.hh
+++ b/dumux/porousmediumflow/mpnc/indices.hh
@@ -24,22 +24,7 @@
 #ifndef DUMUX_MPNC_INDICES_HH
 #define DUMUX_MPNC_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
-
-/*!
- * \ingroup MPNCModel
- * \brief Enumerates the formulations which the MpNc model accepts.
- */
-struct MpNcPressureFormulation
-{
-    enum {
-        mostWettingFirst,
-        leastWettingFirst
-    };
-};
+namespace Dumux {
 
 /*!
  * \ingroup MPNCModel
@@ -47,43 +32,33 @@ struct MpNcPressureFormulation
  *
  * \tparam FluidSystem The fluid system class
  * \tparam numEqBalance Number of balance equations: all transport equations and the constraint equations
- * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class FluidSystem, int numEqBalance, int BasePVOffset = 0>
-class MPNCIndices
+template <int numPhases, int numEqBalance>
+struct MPNCIndices
 {
-     enum { numPhases = FluidSystem::numPhases };
-public:
-
-    //! Phase indices
-    static const int wPhaseIdx = FluidSystem::wPhaseIdx; //!< Index of the wetting phase
-    static const int nPhaseIdx = FluidSystem::nPhaseIdx; //!< Index of the non-wetting phase
-
     /*!
      * \brief Index of the saturation of the first phase in a vector
      *        of primary variables.
      *
-     * The following (numPhases - 1) primary variables represent the
-     * saturations for the phases [1, ..., numPhases - 1]
+     * \note The following (numPhases - 1) primary variables represent the
+     *       saturations for the phases [1, ..., numPhases - 1]
      */
     static const unsigned int s0Idx = numEqBalance - numPhases;
 
     /*!
-     * \brief Index of the first phase' pressure in a vector of
-     *        primary variables.
+     * \brief Index of the first phase' pressure in a vector of primary variables.
      */
     static const unsigned int p0Idx = numEqBalance  - 1;
 
     /*!
      * \brief Index of the first phase NCP equation.
-     *
-     * The index for the remaining phases are consecutive.
+     * \note The index for the remaining phases are consecutive.
      */
     static const unsigned int phase0NcpIdx =  numEqBalance - numPhases;
 
-    static const unsigned int fug0Idx = BasePVOffset + 0;
-    static const unsigned int conti0EqIdx = BasePVOffset + 0;
-    static const unsigned int moleFrac00Idx = BasePVOffset + 0;
+    static const unsigned int fug0Idx = 0;
+    static const unsigned int conti0EqIdx = 0;
+    static const unsigned int moleFrac00Idx = 0;
 };
 
 }
diff --git a/dumux/porousmediumflow/mpnc/localresidual.hh b/dumux/porousmediumflow/mpnc/localresidual.hh
index 96d085609012e7f09119da0d01c093590efb96cf..14cb90a15f6a11ef8ab25551a1dc06f4c3af3a59 100644
--- a/dumux/porousmediumflow/mpnc/localresidual.hh
+++ b/dumux/porousmediumflow/mpnc/localresidual.hh
@@ -50,9 +50,10 @@ class MPNCLocalResidual : public CompositionalLocalResidual<TypeTag>
     using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
-    enum {numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()};
+    enum {numPhases = ModelTraits::numPhases()};
     enum {phase0NcpIdx = Indices::phase0NcpIdx};
 
 public:
diff --git a/dumux/porousmediumflow/mpnc/model.hh b/dumux/porousmediumflow/mpnc/model.hh
index 8f9f6fc832e283655d8d7ba3098393f320735ac5..0b8d9c3eee1534e05976eb45080f1de5c7c6de8f 100644
--- a/dumux/porousmediumflow/mpnc/model.hh
+++ b/dumux/porousmediumflow/mpnc/model.hh
@@ -115,10 +115,11 @@
 #include "volumevariables.hh"
 #include "vtkoutputfields.hh"
 #include "localresidual.hh"
+#include "pressureformulation.hh"
 
 /*!
- * \ingroup \ingroup MPNCModel
- * \brief  Defines the properties required for the MpNc fully implicit model.
+ * \ingroup MPNCModel
+ * \brief Defines the properties required for the MpNc fully implicit model.
  */
 namespace Dumux
 {
@@ -130,7 +131,7 @@ namespace Dumux
  * \tparam nPhases the number of phases to be considered
  * \tparam nComp the number of components to be considered
  */
-template<int nPhases, int nComp>
+template<int nPhases, int nComp, MpNcPressureFormulation formulation>
 struct MPNCModelTraits
 {
     static constexpr int numEq() { return numTransportEq()+numConstraintEq(); }
@@ -144,6 +145,59 @@ struct MPNCModelTraits
     static constexpr bool enableEnergyBalance() { return false; }
     static constexpr bool enableThermalNonEquilibrium() { return false; }
     static constexpr bool enableChemicalNonEquilibrium() { return false; }
+
+    static constexpr MpNcPressureFormulation pressureFormulation() { return formulation; }
+
+    //! Per default, we use the indices without offset
+    using Indices = MPNCIndices< numPhases(), numEq() >;
+};
+
+/*!
+ * \ingroup PorousmediumNonEquilibriumModel
+ * \brief Specifies a number properties of the m-phase n-component model
+ *        in conjunction with non-equilibrium. This is necessary because
+ *        the mpnc indices are affected by the non-equilibrium which can
+ *        thus not be plugged on top of it that easily.
+ *
+ * \tparam NonEquilTraits The model traits of the original non-equilibrium model
+ */
+template<class NonEquilTraits>
+struct MPNCNonequilibriumModelTraits : public NonEquilTraits
+{
+private:
+    //! we overwrite the indices as the underlying mpnc indices depend on numTransportEq,
+    //! which is again dependent on which form of non-equilibrium is considered
+    using MpNcIndices = MPNCIndices< NonEquilTraits::numPhases(),
+                                     NonEquilTraits::numTransportEq()+NonEquilTraits::numConstraintEq() >;
+public:
+    using Indices = NonEquilbriumIndices< MpNcIndices,
+                                          NonEquilTraits::numEnergyEqFluid(),
+                                          NonEquilTraits::numEnergyEqSolid(),
+                                          NonEquilTraits::numEq() >;
+};
+
+/*!
+ * \ingroup MPNCModel
+ * \brief Traits class for the mpnc volume variables.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV,
+         class FSY,
+         class FST,
+         class PT,
+         class MT>
+struct MPNCVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
 };
 
 namespace Properties
@@ -161,20 +215,8 @@ NEW_TYPE_TAG(MPNCNonequil, INHERITS_FROM(MPNC, NonEquilibrium));
 // Properties for the isothermal mpnc model
 //////////////////////////////////////////////////////////////////
 
-//! The indices required by the mpnc model
-SET_PROP(MPNC, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = MPNCIndices<FluidSystem, numEq, /*PVOffset=*/0>;
-};
-
 //! Use the MpNc local residual for the MpNc model
-SET_TYPE_PROP(MPNC,
-              LocalResidual,
-              MPNCLocalResidual<TypeTag>);
+SET_TYPE_PROP(MPNC, LocalResidual,  MPNCLocalResidual<TypeTag>);
 
 //! Set the model traits property
 SET_PROP(MPNC, ModelTraits)
@@ -182,7 +224,9 @@ SET_PROP(MPNC, ModelTraits)
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 public:
-    using type = MPNCModelTraits<FluidSystem::numPhases, FluidSystem::numComponents>;
+    using type = MPNCModelTraits<FluidSystem::numPhases,
+                                 FluidSystem::numComponents,
+                                 GET_PROP_VALUE(TypeTag, PressureFormulation)>;
 };
 
 //! This model uses the compositional fluid state
@@ -195,10 +239,23 @@ public:
     using type = CompositionalFluidState<Scalar, FluidSystem>;
 };
 
+//! Set the volume variables property
+SET_PROP(MPNC, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = MPNCVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = MPNCVolumeVariables<Traits>;
+};
+
 //! Use ImplicitSpatialParams by default.
 SET_TYPE_PROP(MPNC, SpatialParams, FVSpatialParams<TypeTag>);
-//! the VolumeVariables property
-SET_TYPE_PROP(MPNC, VolumeVariables, MPNCVolumeVariables<TypeTag>);
 //! Per default, no component mass balance is replaced
 SET_INT_PROP(MPNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents);
 //! Use mole fractions in the balance equations by default
@@ -206,21 +263,15 @@ SET_BOOL_PROP(MPNC, UseMoles, true);
 //! Use the model after Millington (1961) for the effective diffusivity
 SET_TYPE_PROP(MPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 //! Set the default pressure formulation to the pressure of the (most) wetting phase
-SET_INT_PROP(MPNC,
-             PressureFormulation,
-             MpNcPressureFormulation::mostWettingFirst);
-
-//! Set the vtk output fields specific to this model
-SET_PROP(MPNC, VtkOutputFields)
+SET_PROP(MPNC, PressureFormulation)
 {
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
 public:
-    using type = MPNCVtkOutputFields<FluidSystem, Indices>;
+    static const MpNcPressureFormulation value = MpNcPressureFormulation::mostWettingFirst;
 };
 
+//! Set the vtk output fields specific to this model
+SET_TYPE_PROP(MPNC, VtkOutputFields, MPNCVtkOutputFields);
+
 /////////////////////////////////////////////////
 // Properties for the non-isothermal mpnc model
 /////////////////////////////////////////////////
@@ -230,25 +281,13 @@ SET_PROP(MPNCNI, ModelTraits)
 {
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases, FluidSystem::numComponents>;
+    using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases,
+                                             FluidSystem::numComponents,
+                                             GET_PROP_VALUE(TypeTag, PressureFormulation)>;
 public:
     using type = PorousMediumFlowNIModelTraits<IsothermalTraits>;
 };
 
-//! set non-isothermal Indices
-SET_PROP(MPNCNI, Indices)
-{
-private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-
-    //! The mpnc indices require to be passed the number of equations without energy balance
-    //! TODO can the mpnc model/indexing be realized in a more transparent way?
-    using IsothermalIndices = MPNCIndices<FluidSystem, numEq-1, /*PVOffset=*/0>;
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 /////////////////////////////////////////////////
 // Properties for the non-equilibrium mpnc model
 /////////////////////////////////////////////////
@@ -256,26 +295,24 @@ public:
 SET_TYPE_PROP(MPNCNonequil, EquilibriumLocalResidual, MPNCLocalResidual<TypeTag>);
 
 //! Set the vtk output fields specific to this model
-SET_PROP(MPNCNonequil, EquilibriumVtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-public:
-    using type = MPNCVtkOutputFields<FluidSystem, Indices>;
-};
+SET_TYPE_PROP(MPNCNonequil, EquilibriumVtkOutputFields, MPNCVtkOutputFields);
 
-SET_PROP(MPNCNonequil, EquilibriumIndices)
+//! For non-equilibrium with mpnc we have to overwrite the model traits again,
+//! because the mpnc indices depend on the status of the non-equilibrium model traits
+SET_PROP(MPNCNonequil, ModelTraits)
 {
 private:
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using EquiTraits = typename GET_PROP_TYPE(TypeTag, EquilibriumModelTraits);
+    static constexpr bool enableTNE = GET_PROP_VALUE(TypeTag, EnableThermalNonEquilibrium);
+    static constexpr bool enableCNE = GET_PROP_VALUE(TypeTag, EnableChemicalNonEquilibrium);
+    static constexpr int numEF = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid);
+    static constexpr int numES = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid);
+    static constexpr auto nf = GET_PROP_VALUE(TypeTag, NusseltFormulation);
+    static constexpr auto ns = GET_PROP_VALUE(TypeTag, SherwoodFormulation);
 
-    //! the mpnc indices need the number of all transport equations plus constraint equations
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numTransportEq()
-                                 +GET_PROP_TYPE(TypeTag, ModelTraits)::numConstraintEq();
+    using NonEquilTraits = NonEquilibriumModelTraits<EquiTraits, enableCNE, enableTNE, numEF, numES, nf, ns>;
 public:
-    using type = MPNCIndices<FluidSystem, numEq, /*PVOffset=*/0>;
+    using type = MPNCNonequilibriumModelTraits< NonEquilTraits >;
 };
 
 //! set equilibrium model traits
@@ -284,7 +321,9 @@ SET_PROP(MPNCNonequil, EquilibriumModelTraits)
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 public:
-    using type = MPNCModelTraits<FluidSystem::numPhases, FluidSystem::numComponents>;
+    using type = MPNCModelTraits<FluidSystem::numPhases,
+                                 FluidSystem::numComponents,
+                                 GET_PROP_VALUE(TypeTag, PressureFormulation)>;
 };
 
 //! in case we do not assume full non-equilibrium one needs a thermal conductivity
@@ -292,9 +331,8 @@ SET_PROP(MPNCNonequil, ThermalConductivityModel)
 {
 private:
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 public:
-    using type = ThermalConductivitySimpleFluidLumping<Scalar, GET_PROP_VALUE(TypeTag, NumEnergyEqFluid), Indices>;
+    using type = ThermalConductivitySimpleFluidLumping<Scalar, GET_PROP_VALUE(TypeTag, NumEnergyEqFluid)>;
 };
 
 } //end namespace Properties
diff --git a/dumux/discretization/volumevariables.hh b/dumux/porousmediumflow/mpnc/pressureformulation.hh
similarity index 67%
rename from dumux/discretization/volumevariables.hh
rename to dumux/porousmediumflow/mpnc/pressureformulation.hh
index b6e5056a1f7c84303e7c6b455d26ceb62e4dc110..557e73eec1f638ec68f0c5dae99161c9600b9c18 100644
--- a/dumux/discretization/volumevariables.hh
+++ b/dumux/porousmediumflow/mpnc/pressureformulation.hh
@@ -18,24 +18,24 @@
  *****************************************************************************/
 /*!
  * \file
- * \ingroup PorousMediumFlow
- * \brief Base class for the model specific class which provides
- *        access to all volume averaged quantities.
+ * \ingroup MPNCModel
+ * \brief Enumeration of the formulations accepted by the MpNc model.
  */
-#ifndef DUMUX_DISCRETIZATION_VOLUME_VARIABLES_DEPR_HH
-#define DUMUX_DISCRETIZATION_VOLUME_VARIABLES_DEPR_HH
-
-#warning "This header is deprecated. Use PorousMediumFlowVolumeVariables from dumux/porousmediumflow/volumevariables.hh"
-#include <dune/common/deprecated.hh>
-#include <dumux/porousmediumflow/volumevariables.hh>
+#ifndef DUMUX_MPNC_PRESSUREFORMULATION_HH
+#define DUMUX_MPNC_PRESSUREFORMULATION_HH
 
 namespace Dumux
 {
 
-template<class TypeTag>
-using ImplicitVolumeVariables DUNE_DEPRECATED_MSG("Use PorousMediumFlowVolumeVariables from dumux/porousmediumflow/volumevariables.hh")
-= PorousMediumFlowVolumeVariables<TypeTag>;
+/*!
+ * \ingroup MPNCModel
+ * \brief Enumerates the formulations which the MpNc model accepts.
+ */
+enum class MpNcPressureFormulation
+{
+    mostWettingFirst, leastWettingFirst
+};
 
-} // end namespace Dumux
+}
 
 #endif
diff --git a/dumux/porousmediumflow/mpnc/volumevariables.hh b/dumux/porousmediumflow/mpnc/volumevariables.hh
index 7a69f44b09f1aa2b3bfdc9a9a268aa84b186f990..4763cb2ff26dd63c2aadd409068ec3b0ed5b184d 100644
--- a/dumux/porousmediumflow/mpnc/volumevariables.hh
+++ b/dumux/porousmediumflow/mpnc/volumevariables.hh
@@ -25,141 +25,134 @@
 #ifndef DUMUX_MPNC_VOLUME_VARIABLES_HH
 #define DUMUX_MPNC_VOLUME_VARIABLES_HH
 
-#include "indices.hh"
+#include <dumux/material/constraintsolvers/ncpflash.hh>
+#include <dumux/material/constraintsolvers/compositionfromfugacities.hh>
 
-#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/nonequilibrium/volumevariables.hh>
 #include <dumux/porousmediumflow/volumevariables.hh>
 
-#include <dumux/material/constraintsolvers/ncpflash.hh>
-#include <dumux/material/constraintsolvers/compositionfromfugacities.hh>
+#include "pressureformulation.hh"
 
 namespace Dumux
 {
+
 /*!
  * \ingroup MPNCModel
- * \brief Contains the quantities which are constant within a
- *        finite volume in the MpNc model.
+ * \brief Contains the quantities which are constant within a finite volume in the MpNc model.
+ *
+ * \tparam Traits Class encapsulating types to be used by the vol vars
  */
-template <class TypeTag>
+template <class Traits>
 class MPNCVolumeVariables
-    : public PorousMediumFlowVolumeVariables<TypeTag>
-    , public NonEquilibriumVolumeVariables<TypeTag>
+    : public PorousMediumFlowVolumeVariables< Traits, MPNCVolumeVariables<Traits> >
+    , public NonEquilibriumVolumeVariables< Traits >
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using Element = typename GridView::template Codim<0>::Entity;
-
-    // formulations
-    enum {
-        pressureFormulation = GET_PROP_VALUE(TypeTag, PressureFormulation),
-        mostWettingFirst    = MpNcPressureFormulation::mostWettingFirst,
-        leastWettingFirst   = MpNcPressureFormulation::leastWettingFirst
-    };
+    using ParentType = PorousMediumFlowVolumeVariables< Traits, MPNCVolumeVariables<Traits> >;
+    using NonEqVolVars = NonEquilibriumVolumeVariables< Traits >;
 
-    enum {numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()};
-    enum {numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()};
-    enum {s0Idx = Indices::s0Idx};
-    enum {p0Idx = Indices::p0Idx};
-    enum {fug0Idx = Indices::fug0Idx};
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
 
-    static constexpr bool enableThermalNonEquilibrium = GET_PROP_TYPE(TypeTag, ModelTraits)::enableThermalNonEquilibrium();
-    static constexpr bool enableChemicalNonEquilibrium = GET_PROP_TYPE(TypeTag, ModelTraits)::enableChemicalNonEquilibrium();
-    static constexpr bool enableDiffusion = GET_PROP_TYPE(TypeTag, ModelTraits)::enableMolecularDiffusion();
+    using ModelTraits = typename Traits::ModelTraits;
+    static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
 
+    static constexpr bool enableThermalNonEquilibrium = ModelTraits::enableThermalNonEquilibrium();
+    static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
+    static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion();
 
-    using ComponentVector = Dune::FieldVector<Scalar, numComponents>;
-    using CompositionFromFugacities = Dumux::CompositionFromFugacities<Scalar, FluidSystem>;
+    using Indices = typename ModelTraits::Indices;
+    using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numComponents()>;
+    using CompositionFromFugacities = Dumux::CompositionFromFugacities<Scalar, typename Traits::FluidSystem>;
 
 public:
-    // export type of fluid state for non-isothermal models
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-    using ParentType::ParentType;
-
-    MPNCVolumeVariables()
-    { };
+    //! export the underlying fluid system
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export the fluid state type
+    using FluidState = typename Traits::FluidState;
 
+    //! return number of phases considered by the model
+    static constexpr int numPhases() { return ModelTraits::numPhases(); }
+    //! return number of components considered by the model
+    static constexpr int numComponents() { return ModelTraits::numComponents(); }
 
     /*!
-     * \copydoc ImplicitVolumeVariables::update
+     * \brief Update all quantities for a given control volume
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param problem The object specifying the problem which ought to
+     *                be simulated
+     * \param element An element which contains part of the control volume
+     * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
-                const Problem &problem,
-                const Element &element,
-                const SubControlVolume& scv)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol& elemSol,
+                const Problem& problem,
+                const Element& element,
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
-
         completeFluidState(elemSol, problem, element, scv, fluidState_);
 
         //calculate the remaining quantities
         const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
+
         // relative permeabilities
-        MaterialLaw::relativePermeabilities(relativePermeability_,
-                                            materialParams,
-                                            fluidState_);
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
+        MaterialLaw::relativePermeabilities(relativePermeability_, materialParams, fluidState_);
+
+        // binary diffusion coefficients
         typename FluidSystem::ParameterCache paramCache;
         paramCache.updateAll(fluidState_);
         if (enableDiffusion)
         {
-            for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx)
             {
                 int compIIdx = phaseIdx;
-                for (unsigned int compJIdx = 0; compJIdx < numComponents; ++compJIdx)
-                {
-                    // binary diffusion coefficients
+                for (unsigned int compJIdx = 0; compJIdx < numComponents(); ++compJIdx)
                     if(compIIdx!= compJIdx)
-                    {
                         setDiffusionCoefficient_(phaseIdx, compJIdx,
                                                 FluidSystem::binaryDiffusionCoefficient(fluidState_,
                                                                                         paramCache,
                                                                                         phaseIdx,
                                                                                         compIIdx,
                                                                                         compJIdx));
-                    }
-                }
             }
         }
 
         porosity_ = problem.spatialParams().porosity(element, scv, elemSol);
         permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
 
-        //only do this if we are either looking at chemical or thermal non-equilibrium. or both
+        // only do this if we are either looking at chemical and/or thermal non-equilibrium
         if (enableChemicalNonEquilibrium || enableThermalNonEquilibrium)
         {
-        // specific interfacial area,
-        // well also all the dimensionless numbers :-)
-        // well, also the mass transfer rate
-            this->updateInterfacialArea(elemSol,
-                                        fluidState_,
-                                        paramCache,
-                                        problem,
-                                        element,
-                                        scv);
+            // specific interfacial area,
+            // well, also all the dimensionless numbers :-)
+            // well, also the mass transfer rate
+            NonEqVolVars::updateInterfacialArea(elemSol,
+                                                fluidState_,
+                                                paramCache,
+                                                problem,
+                                                element,
+                                                scv);
         }
     }
 
     /*!
-     * \copydoc ImplicitModel::completeFluidState
-     * \param isOldSol Specifies whether this is the previous solution or the current one
+     * \brief Set complete fluid state
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param problem The object specifying the problem which ought to
+     *                be simulated
+     * \param element An element which contains part of the control volume
+     * \param scv The sub-control volume
+     * \param fluidState A container with the current (physical) state of the fluid
      */
-     template<class ElementSolution>
-     void completeFluidState(const ElementSolution& elemSol,
-                                   const Problem& problem,
-                                   const Element& element,
-                                   const SubControlVolume& scv,
-                                   FluidState& fluidState)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void completeFluidState(const ElemSol& elemSol,
+                            const Problem& problem,
+                            const Element& element,
+                            const Scv& scv,
+                            FluidState& fluidState)
     {
         /////////////
         // set the fluid phase temperatures
@@ -170,52 +163,52 @@ public:
             fluidState.setTemperature(t);
         }
         else
-        {
-            this->updateTemperatures(elemSol,
-                                     problem,
-                                      element,
-                                      scv,
-                                      fluidState);
-        }
+            NonEqVolVars::updateTemperatures(elemSol, problem, element, scv, fluidState);
+
         /////////////
         // set the phase saturations
         /////////////
-        auto&& priVars = ParentType::extractDofPriVars(elemSol, scv);
+        const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
+
         Scalar sumSat = 0;
-        for (int phaseIdx = 0; phaseIdx < numPhases - 1; ++phaseIdx) {
-            sumSat += priVars[s0Idx + phaseIdx];
-            fluidState.setSaturation(phaseIdx, priVars[s0Idx + phaseIdx]);
+        for (int phaseIdx = 0; phaseIdx < numPhases() - 1; ++phaseIdx)
+        {
+            sumSat += priVars[Indices::s0Idx + phaseIdx];
+            fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
         }
-        Valgrind::CheckDefined(sumSat);
-        fluidState.setSaturation(numPhases - 1, 1.0 - sumSat);
+
+        fluidState.setSaturation(numPhases() - 1, 1.0 - sumSat);
 
         /////////////
         // set the phase pressures
         /////////////
-        // capillary pressure parameters
-        const auto& materialParams =
-            problem.spatialParams().materialLawParams(element, scv, elemSol);
+        const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
+
         // capillary pressures
-        Scalar capPress[numPhases];
+        Scalar capPress[numPhases()];
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         MaterialLaw::capillaryPressures(capPress, materialParams, fluidState);
-        // add to the pressure of the first fluid phase
 
+        // add to the pressure of the first fluid phase,
         // depending on which pressure is stored in the primary variables
-        if(pressureFormulation == mostWettingFirst){
+        if(pressureFormulation == MpNcPressureFormulation::mostWettingFirst)
+        {
             // This means that the pressures are sorted from the most wetting to the least wetting-1 in the primary variables vector.
             // For two phases this means that there is one pressure as primary variable: pw
-            const Scalar pw = priVars[p0Idx];
-            for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            const Scalar pw = priVars[Indices::p0Idx];
+            for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx)
                 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
         }
-        else if(pressureFormulation == leastWettingFirst){
+        else if(pressureFormulation == MpNcPressureFormulation::leastWettingFirst)
+        {
             // This means that the pressures are sorted from the least wetting to the most wetting-1 in the primary variables vector.
             // For two phases this means that there is one pressure as primary variable: pn
-            const Scalar pn = priVars[p0Idx];
-            for (int phaseIdx = numPhases-1; phaseIdx >= 0; --phaseIdx)
-                fluidState.setPressure(phaseIdx, pn - capPress[numPhases-1] + capPress[phaseIdx]);
+            const Scalar pn = priVars[Indices::p0Idx];
+            for (int phaseIdx = numPhases()-1; phaseIdx >= 0; --phaseIdx)
+                fluidState.setPressure(phaseIdx, pn - capPress[numPhases()-1] + capPress[phaseIdx]);
         }
-        else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << pressureFormulation << " is invalid.");
+        else
+            DUNE_THROW(Dune::InvalidStateException, "MPNCVolumeVariables do not support the chosen pressure formulation");
 
         /////////////
         // set the fluid compositions
@@ -225,43 +218,38 @@ public:
 
         ComponentVector fug;
         // retrieve component fugacities
-        for (int compIdx = 0; compIdx < numComponents; ++compIdx)
-            fug[compIdx] = priVars[fug0Idx + compIdx];
+        for (int compIdx = 0; compIdx < numComponents(); ++compIdx)
+            fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
 
         if(!enableChemicalNonEquilibrium)
         {
             // calculate phase compositions
-            for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
+            for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx)
+            {
                 // initial guess
-                for (int compIdx = 0; compIdx < numComponents; ++compIdx) {
-                    Scalar x_ij = 1.0/numComponents;
+                for (int compIdx = 0; compIdx < numComponents(); ++compIdx)
+                {
+                    Scalar x_ij = 1.0/numComponents();
 
                     // set initial guess of the component's mole fraction
-                    fluidState.setMoleFraction(phaseIdx,
-                                            compIdx,
-                                            x_ij);
+                    fluidState.setMoleFraction(phaseIdx, compIdx, x_ij);
                 }
-                // calculate the phase composition from the component
-                // fugacities
+
+                // calculate the phase composition from the component fugacities
                 CompositionFromFugacities::guessInitial(fluidState, paramCache, phaseIdx, fug);
                 CompositionFromFugacities::solve(fluidState, paramCache, phaseIdx, fug);
             }
         }
         else
-        {
-            this->updateMoleFraction(fluidState,
-                                     paramCache,
-                                     priVars);
-        }
+            NonEqVolVars::updateMoleFraction(fluidState, paramCache, priVars);
 
-        // dynamic viscosities
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
-            // viscosities
-            Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx);
+        // dynamic viscosities and enthalpies
+        for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx)
+        {
+            const auto mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx);
             fluidState.setViscosity(phaseIdx, mu);
 
-            // compute and set the enthalpy
-            Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
+            const auto h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
             fluidState.setEnthalpy(phaseIdx, h);
         }
 
@@ -435,10 +423,8 @@ public:
      */
     bool isPhaseActive(const unsigned int phaseIdx) const
     {
-        return
-            phasePresentIneq(fluidState(), phaseIdx) -
-            phaseNotPresentIneq(fluidState(), phaseIdx)
-            >= 0;
+        return phasePresentIneq(fluidState(), phaseIdx) -
+               phaseNotPresentIneq(fluidState(), phaseIdx) >= 0;
     }
 
     /*!
@@ -491,12 +477,12 @@ public:
     {
         // difference of sum of mole fractions in the phase from 100%
         Scalar a = 1;
-        for (int compIdx = 0; compIdx < numComponents; ++compIdx)
+        for (int compIdx = 0; compIdx < numComponents(); ++compIdx)
             a -= fluidState.moleFraction(phaseIdx, compIdx);
         return a;
     }
 
-protected:
+private:
 
     void setDiffusionCoefficient_(int phaseIdx, int compIdx, Scalar d)
     {
@@ -508,9 +494,9 @@ protected:
             DUNE_THROW(Dune::InvalidStateException, "Diffusion coefficient for phaseIdx = compIdx doesn't exist");
     }
 
-    std::array<std::array<Scalar, numComponents-1>, numPhases> diffCoefficient_;
+    std::array<std::array<Scalar, numComponents()-1>, numPhases()> diffCoefficient_;
     Scalar porosity_; //!< Effective porosity within the control volume
-    Scalar relativePermeability_[numPhases]; //!< Effective relative permeability within the control volume
+    Scalar relativePermeability_[numPhases()]; //!< Effective relative permeability within the control volume
     PermeabilityType permeability_;
 
     //! Mass fractions of each component within each phase
diff --git a/dumux/porousmediumflow/mpnc/vtkoutputfields.hh b/dumux/porousmediumflow/mpnc/vtkoutputfields.hh
index 415a371a628e3912ae596d22ba69f93983d62ef3..3d229fed7c39fa67baa19741c63b1fd590f8c0d3 100644
--- a/dumux/porousmediumflow/mpnc/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/mpnc/vtkoutputfields.hh
@@ -24,39 +24,32 @@
 #ifndef DUMUX_MPNC_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_MPNC_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
 namespace Dumux {
 
 /*!
  * \ingroup MPNCModel
  * \brief Adds vtk output fields specific to the twop model
  */
-template<class FluidSystem, class Indices>
 class MPNCVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i));
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
 
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
+        vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+        {
+            vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i));
             vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i));
-
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
             vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i));
-
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
             vtk.addVolumeVariable([i](const auto& v){ return v.mobility(i); },"lambda_"+ FluidSystem::phaseName(i));
 
-        vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
-
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
                 vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x_"+ FluidSystem::phaseName(i) + "^" + FluidSystem::componentName(j));
+        }
     }
 };
 
diff --git a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh
index 269866951fddc3835c6307ebb63c81ef744e6745..9e619befea78503939de09484a620df6d0097088 100644
--- a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh
+++ b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh
@@ -47,7 +47,6 @@ class NonEquilibriumGridVariables
                                        typename GET_PROP_TYPE(TypeTag, GridVolumeVariables),
                                        typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)>;
 
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using GridView = typename FVGridGeometry::GridView;
@@ -60,16 +59,17 @@ class NonEquilibriumGridVariables
     static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
 
 public:
+    //! export the type used for scalar values
+    using typename ParentType::Scalar;
+
     //! Constructor
     NonEquilibriumGridVariables(std::shared_ptr<Problem> problem,
                                 std::shared_ptr<FVGridGeometry> fvGridGeometry)
     : ParentType(problem, fvGridGeometry)
     , problem_(problem)
     {
-        for (int phaseIdx =0; phaseIdx<numPhases; ++phaseIdx)
-        {
+        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
             velocityNorm_[phaseIdx].assign(fvGridGeometry->numDofs(), 0.0);
-        }
     }
 
     template<class SolutionVector>
@@ -95,7 +95,6 @@ public:
             auto elemVolVars = localView(this->curGridVolVars());
 
             fvGeometry.bind(element);
-
             elemVolVars.bind(element, fvGeometry, curSol);
 
             for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
diff --git a/dumux/porousmediumflow/nonequilibrium/indices.hh b/dumux/porousmediumflow/nonequilibrium/indices.hh
index fba15c9b0238e1fe4efeae70ded202018497fdd2..adafd1590a87347af2cd528ef97f603a190a97a5 100644
--- a/dumux/porousmediumflow/nonequilibrium/indices.hh
+++ b/dumux/porousmediumflow/nonequilibrium/indices.hh
@@ -24,34 +24,27 @@
 #ifndef DUMUX_NONEQUILIBRIUM_INDICES_HH
 #define DUMUX_NONEQUILIBRIUM_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup PorousmediumNonEquilibriumModel
  * \brief The primary variable and equation indices for the MpNc model.
  */
-template <class EquilibriumIndices, class FluidSystem, int numEnergyEquationFluid, int numEnergyEquationSolid, int numEq, int BasePVOffset = 0>
-class NonEquilbriumIndices: public EquilibriumIndices
+template <class EquilibriumIndices, int numEnergyEqFluid, int numEnergyEqSolid, int numEq>
+class NonEquilbriumIndices : public EquilibriumIndices
 {
 public:
-     enum { numPhases = FluidSystem::numPhases };
-     enum { numEnergyEqFluid = numEnergyEquationFluid };
-     enum { numEnergyEqSolid = numEnergyEquationSolid };
-
     /*!
      * \brief Index for the temperature of the wetting phase in a vector of primary
      *        variables.
      */
-    static constexpr unsigned int temperature0Idx = BasePVOffset + numEq - numEnergyEqFluid - numEnergyEqSolid;
+    static constexpr unsigned int temperature0Idx = numEq - numEnergyEqFluid - numEnergyEqSolid;
 
     /*!
      * \brief Index for the temperature of the solid phase in a vector of primary
      *        variables.
      */
-    static constexpr unsigned int temperatureSolidIdx = BasePVOffset + numEq - numEnergyEqSolid;
+    static constexpr unsigned int temperatureSolidIdx = numEq - numEnergyEqSolid;
     /*!
      * \brief Compatibility with non kinetic models
      */
@@ -59,7 +52,7 @@ public:
     /*!
      * \brief Equation index of the energy equation.
      */
-    static constexpr unsigned int energyEq0Idx = BasePVOffset + numEq - numEnergyEqFluid - numEnergyEqSolid;
+    static constexpr unsigned int energyEq0Idx = numEq - numEnergyEqFluid - numEnergyEqSolid;
     /*!
      * \brief Compatibility with non kinetic models
      */
@@ -68,7 +61,7 @@ public:
     /*!
      * \brief Equation index of the energy equation.
      */
-    static constexpr unsigned int energyEqSolidIdx = BasePVOffset + numEq - numEnergyEqSolid;
+    static constexpr unsigned int energyEqSolidIdx = numEq - numEnergyEqSolid;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/nonequilibrium/localresidual.hh b/dumux/porousmediumflow/nonequilibrium/localresidual.hh
index 4bc8d8288f3288838d52ec36bc1e97a5c80875f0..5ac069eeec690471443d6922376762e10d351599 100644
--- a/dumux/porousmediumflow/nonequilibrium/localresidual.hh
+++ b/dumux/porousmediumflow/nonequilibrium/localresidual.hh
@@ -53,14 +53,15 @@ class NonEquilibriumLocalResidualImplementation<TypeTag, true, false>: public GE
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
-    static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases();
-    static constexpr int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents();
+    static constexpr int numPhases = ModelTraits::numPhases();
+    static constexpr int numComponents = ModelTraits::numComponents();
     enum { conti0EqIdx = Indices::conti0EqIdx };
 public:
     using ParentType::ParentType;
@@ -164,7 +165,6 @@ class NonEquilibriumLocalResidualImplementation<TypeTag, true, true>: public GET
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
@@ -174,16 +174,19 @@ class NonEquilibriumLocalResidualImplementation<TypeTag, true, true>: public GET
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using MolecularDiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType);
 
-    static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases();
-    static constexpr int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents();
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
+    static constexpr int numPhases = ModelTraits::numPhases();
+    static constexpr int numComponents = ModelTraits::numComponents();
     static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
     using ComponentVector = Dune::FieldVector<Scalar, numComponents>;
 
     enum { conti0EqIdx = Indices::conti0EqIdx };
-    enum { nCompIdx = FluidSystem::nCompIdx } ;
-    enum { wCompIdx = FluidSystem::wCompIdx } ;
-    enum { wPhaseIdx = FluidSystem::wPhaseIdx} ;
-    enum { nPhaseIdx = FluidSystem::nPhaseIdx} ;
+    enum { comp1Idx = FluidSystem::comp1Idx } ;
+    enum { comp0Idx = FluidSystem::comp0Idx } ;
+    enum { phase0Idx = FluidSystem::phase0Idx} ;
+    enum { phase1Idx = FluidSystem::phase1Idx} ;
     enum { sPhaseIdx = FluidSystem::sPhaseIdx} ;
 
 public:
@@ -283,11 +286,11 @@ public:
         ComponentVector componentIntoPhaseMassTransfer[numPhases];
 #define FUNKYMASSTRANSFER 0
 #if FUNKYMASSTRANSFER
-        const Scalar mu_nPhaseNCompEquil = volVars.chemicalPotentialEquil(nPhaseIdx, nCompIdx) ;   // very 2p2c
-        const Scalar mu_wPhaseWCompEquil = volVars.chemicalPotentialEquil(wPhaseIdx, wCompIdx);    // very 2p2c
+        const Scalar mu_nPhaseNCompEquil = volVars.chemicalPotentialEquil(phase1Idx, comp1Idx) ;   // very 2p2c
+        const Scalar mu_wPhaseWCompEquil = volVars.chemicalPotentialEquil(phase0Idx, comp0Idx);    // very 2p2c
 
-        const Scalar mu_wPhaseNComp = volVars.chemicalPotential(wPhaseIdx, nCompIdx) ;   // very 2p2c
-        const Scalar mu_nPhaseWComp = volVars.chemicalPotential(nPhaseIdx, wCompIdx);    // very 2p2c
+        const Scalar mu_wPhaseNComp = volVars.chemicalPotential(phase0Idx, comp1Idx) ;   // very 2p2c
+        const Scalar mu_nPhaseWComp = volVars.chemicalPotential(phase1Idx, comp0Idx);    // very 2p2c
 
         Valgrind::CheckDefined(mu_nPhaseNCompEquil);
         Valgrind::CheckDefined(mu_wPhaseWCompEquil);
@@ -295,8 +298,8 @@ public:
         Valgrind::CheckDefined(mu_nPhaseWComp);
 
         const Scalar characteristicLength   = volVars.characteristicLength()  ;
-        const Scalar temperature            = volVars.temperature(wPhaseIdx);
-        const Scalar pn                     = volVars.pressure(nPhaseIdx);
+        const Scalar temperature            = volVars.temperature(phase0Idx);
+        const Scalar pn                     = volVars.pressure(phase1Idx);
         const Scalar henry                  = FluidSystem::henry(temperature) ;
         const Scalar gradNinWApprox  = ( mu_wPhaseNComp - mu_nPhaseNCompEquil) / characteristicLength;    // very 2p2c // 1. / henry *
         const Scalar gradWinNApprox  = ( mu_nPhaseWComp - mu_wPhaseWCompEquil) / characteristicLength;    // very 2p2c // 1. / pn *
@@ -311,13 +314,13 @@ public:
         Valgrind::CheckDefined(x);
 
 //      "equilibrium" values: calculated in volume variables
-        const Scalar x_wPhaseNCompEquil = volVars.xEquil(wPhaseIdx, nCompIdx) ;   // very 2p2c
-        const Scalar x_nPhaseWCompEquil = volVars.xEquil(nPhaseIdx, wCompIdx);    // very 2p2c
+        const Scalar x_wPhaseNCompEquil = volVars.xEquil(phase0Idx, comp1Idx) ;   // very 2p2c
+        const Scalar x_nPhaseWCompEquil = volVars.xEquil(phase1Idx, comp0Idx);    // very 2p2c
         Valgrind::CheckDefined(x_wPhaseNCompEquil);
         Valgrind::CheckDefined(x_nPhaseWCompEquil);
         const Scalar characteristicLength   = volVars.characteristicLength()  ;
-        const Scalar gradNinWApprox  =  (x[wPhaseIdx][nCompIdx] - x_wPhaseNCompEquil) / characteristicLength;    // very 2p2c
-        const Scalar gradWinNApprox  =  (x[nPhaseIdx][wCompIdx] - x_nPhaseWCompEquil) / characteristicLength;    // very 2p2c
+        const Scalar gradNinWApprox  =  (x[phase0Idx][comp1Idx] - x_wPhaseNCompEquil) / characteristicLength;    // very 2p2c
+        const Scalar gradWinNApprox  =  (x[phase1Idx][comp0Idx] - x_nPhaseWCompEquil) / characteristicLength;    // very 2p2c
 #endif
         Scalar phaseDensity[numPhases];
         for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx){
@@ -325,31 +328,31 @@ public:
         }
 
         // diffusion coefficients in wetting phase
-        const Scalar diffCoeffNinW = volVars.diffusionCoefficient(wPhaseIdx, nCompIdx) ;
+        const Scalar diffCoeffNinW = volVars.diffusionCoefficient(phase0Idx, comp1Idx) ;
         Valgrind::CheckDefined(diffCoeffNinW);
         // diffusion coefficients in non-wetting phase
-        const Scalar diffCoeffWinN = volVars.diffusionCoefficient(nPhaseIdx, wCompIdx) ;
+        const Scalar diffCoeffWinN = volVars.diffusionCoefficient(phase1Idx, comp0Idx) ;
         Valgrind::CheckDefined(diffCoeffWinN);
 
         const Scalar factorMassTransfer     = volVars.factorMassTransfer()  ;
-        const Scalar awn = volVars.interfacialArea(wPhaseIdx, nPhaseIdx);
+        const Scalar awn = volVars.interfacialArea(phase0Idx, phase1Idx);
 
-        const Scalar sherwoodWPhase  = volVars.sherwoodNumber(wPhaseIdx);
-        const Scalar sherwoodNPhase  = volVars.sherwoodNumber(nPhaseIdx);
+        const Scalar sherwoodWPhase  = volVars.sherwoodNumber(phase0Idx);
+        const Scalar sherwoodNPhase  = volVars.sherwoodNumber(phase1Idx);
 
         //      actual diffusion is always calculated for eq's 2,3
         //      Eq's 1,4 have to be the same with different sign, because no mass is accumulated in the interface
         //      i.e. automatically conserving mass that mvoes across the interface
 
-        const Scalar nCompIntoWPhase  = - factorMassTransfer * gradNinWApprox * awn * phaseDensity[wPhaseIdx] * diffCoeffNinW * sherwoodWPhase;
+        const Scalar nCompIntoWPhase  = - factorMassTransfer * gradNinWApprox * awn * phaseDensity[phase0Idx] * diffCoeffNinW * sherwoodWPhase;
         const Scalar nCompIntoNPhase  = - nCompIntoWPhase ;
-        const Scalar wCompIntoNPhase  = - factorMassTransfer * gradWinNApprox * awn * phaseDensity[nPhaseIdx] * diffCoeffWinN * sherwoodNPhase;
+        const Scalar wCompIntoNPhase  = - factorMassTransfer * gradWinNApprox * awn * phaseDensity[phase1Idx] * diffCoeffWinN * sherwoodNPhase;
         const Scalar wCompIntoWPhase  = - wCompIntoNPhase ;
 
-        componentIntoPhaseMassTransfer[wPhaseIdx][nCompIdx] = nCompIntoWPhase;
-        componentIntoPhaseMassTransfer[nPhaseIdx][nCompIdx] = nCompIntoNPhase;
-        componentIntoPhaseMassTransfer[nPhaseIdx][wCompIdx] = wCompIntoNPhase;
-        componentIntoPhaseMassTransfer[wPhaseIdx][wCompIdx] = wCompIntoWPhase;
+        componentIntoPhaseMassTransfer[phase0Idx][comp1Idx] = nCompIntoWPhase;
+        componentIntoPhaseMassTransfer[phase1Idx][comp1Idx] = nCompIntoNPhase;
+        componentIntoPhaseMassTransfer[phase1Idx][comp0Idx] = wCompIntoNPhase;
+        componentIntoPhaseMassTransfer[phase0Idx][comp0Idx] = wCompIntoWPhase;
 
         Valgrind::CheckDefined(componentIntoPhaseMassTransfer);
 
diff --git a/dumux/porousmediumflow/nonequilibrium/model.hh b/dumux/porousmediumflow/nonequilibrium/model.hh
index 9b4f8b2389426c4ef3e79b49f724d8929967e46d..648f390b353b901e2b4e8bfcebfa9573a7a6a86f 100644
--- a/dumux/porousmediumflow/nonequilibrium/model.hh
+++ b/dumux/porousmediumflow/nonequilibrium/model.hh
@@ -56,8 +56,10 @@ namespace Dumux
  * \tparam therm Boolean to indicate if thermal non-equilibrium is to be considered
  * \tparam numEF Number of energy balance equations to be solved for the fluids
  * \tparam numES Number of energy balance equations to be solved for the solids
+ * \tparam nf Formulation used for the computation of the nusselt number
+ * \tparam sf Formulation used for the computation of the sherwood number
  */
-template<class ET, bool chem, bool therm, int numEF, int numES>
+template<class ET, bool chem, bool therm, int numEF, int numES, NusseltFormulation nf, SherwoodFormulation sf>
 struct NonEquilibriumModelTraits : public ET
 {
     static constexpr int numEq() { return numEnergyEqFluid()+numEnergyEqSolid()+numTransportEq()+ET::numConstraintEq(); }
@@ -69,6 +71,11 @@ struct NonEquilibriumModelTraits : public ET
     static constexpr bool enableEnergyBalance() { return ET::enableEnergyBalance() || therm; }
     static constexpr bool enableThermalNonEquilibrium() { return therm; }
     static constexpr bool enableChemicalNonEquilibrium() { return chem; }
+
+    static constexpr NusseltFormulation nusseltFormulation() { return nf; }
+    static constexpr SherwoodFormulation sherwoodFormulation() { return sf; }
+
+    using Indices = NonEquilbriumIndices<typename ET::Indices, numEnergyEqFluid(), numEnergyEqSolid(), numEq()>;
 };
 
 namespace Properties
@@ -92,8 +99,10 @@ private:
     static constexpr bool enableCNE = GET_PROP_VALUE(TypeTag, EnableChemicalNonEquilibrium);
     static constexpr int numEF = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid);
     static constexpr int numES = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid);
+    static constexpr auto nf = GET_PROP_VALUE(TypeTag, NusseltFormulation);
+    static constexpr auto ns = GET_PROP_VALUE(TypeTag, SherwoodFormulation);
 public:
-    using type = NonEquilibriumModelTraits<EquiTraits, enableCNE, enableTNE, numEF, numES>;
+    using type = NonEquilibriumModelTraits<EquiTraits, enableCNE, enableTNE, numEF, numES, nf, ns>;
 };
 
 //! Per default, we consider both thermal and chemical non-equilibrium
@@ -102,32 +111,12 @@ SET_BOOL_PROP(NonEquilibrium, EnableChemicalNonEquilibrium, true);
 
 //! Default values for the number of energy balance equations
 SET_INT_PROP(NonEquilibrium, NumEnergyEqSolid, 1);
-SET_PROP(NonEquilibrium, NumEnergyEqFluid)
-{
-private:
-    using EquiTraits = typename GET_PROP_TYPE(TypeTag, EquilibriumModelTraits);
-public:
-    static const int value = EquiTraits::numPhases();
-};
+SET_INT_PROP(NonEquilibrium, NumEnergyEqFluid, GET_PROP_TYPE(TypeTag, EquilibriumModelTraits)::numPhases());
 
 SET_TYPE_PROP(NonEquilibrium, EnergyLocalResidual, EnergyLocalResidualNonEquilibrium<TypeTag, GET_PROP_VALUE(TypeTag, NumEnergyEqFluid)>);
 SET_TYPE_PROP(NonEquilibrium, LocalResidual, NonEquilibriumLocalResidual<TypeTag>);
 SET_TYPE_PROP(NonEquilibrium, HeatConductionType, FouriersLawNonEquilibrium<TypeTag>);
 
-//! indices for non-isothermal models
-SET_PROP(NonEquilibrium, Indices)
-{
-private:
-    using EquilibriumIndices = typename GET_PROP_TYPE(TypeTag, EquilibriumIndices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
-    static constexpr int numEF = ModelTraits::numEnergyEqFluid();
-    static constexpr int numES = ModelTraits::numEnergyEqSolid();
-    static constexpr int numEq = ModelTraits::numEq();
-public:
-    using type = NonEquilbriumIndices<EquilibriumIndices, FluidSystem, numEF, numES, numEq, 0>;
-};
-
 SET_PROP(NonEquilibrium, FluidState)
 {
 private:
@@ -145,34 +134,25 @@ SET_PROP(NonEquilibrium, VtkOutputFields)
 {
 private:
     using EquilibriumVtkOutputFields = typename GET_PROP_TYPE(TypeTag, EquilibriumVtkOutputFields);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-
-    static constexpr int numEF = GET_PROP_TYPE(TypeTag, ModelTraits)::numEnergyEqFluid();
-    static constexpr int numES = GET_PROP_TYPE(TypeTag, ModelTraits)::numEnergyEqSolid();
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
 public:
-     using type = NonEquilibriumVtkOutputFields<EquilibriumVtkOutputFields, FluidSystem, numEF, numES>;
+     using type = NonEquilibriumVtkOutputFields<ModelTraits, EquilibriumVtkOutputFields>;
 };
 
 SET_PROP(NonEquilibrium, NusseltFormulation)
 {
-    private:
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using DimLessNum =  DimensionlessNumbers<Scalar>;
-    public:
-    static constexpr int value = DimLessNum::NusseltFormulation::WakaoKaguei;
+public:
+    static constexpr NusseltFormulation value = NusseltFormulation::WakaoKaguei;
 };
 
 /*!
  * \brief Set the default formulation for the sherwood correlation
  *        Other possible parametrizations can be found in the dimensionlessnumbers
  */
-SET_PROP(NonEquilibrium, SherwoodFormulation )
+SET_PROP(NonEquilibrium, SherwoodFormulation)
 {
-    private:
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using DimLessNum =  DimensionlessNumbers<Scalar>;
-    public:
-    static constexpr int value = DimLessNum::SherwoodFormulation::WakaoKaguei;
+public:
+    static constexpr SherwoodFormulation value = SherwoodFormulation::WakaoKaguei;
 };
 
 } //end namespace Properties
diff --git a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh
index 63ee4d49e207875a54b96617a7e03a6265abbbd7..6a4fff355eb393ae46aef8c8bfbd204db3479a40 100644
--- a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh
+++ b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh
@@ -49,26 +49,26 @@ class EnergyLocalResidualNonEquilibrium<TypeTag, 1/*numEnergyEqFluid*/>
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
 
-    enum { numEnergyEqFluid = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid) };
-    enum { numEnergyEqSolid = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid) };
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
+    enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() };
+    enum { numEnergyEqSolid = ModelTraits::numEnergyEqSolid() };
     enum { energyEq0Idx = Indices::energyEq0Idx };
     enum { energyEqSolidIdx = Indices::energyEqSolidIdx};
 
-    enum { numComponents    = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents() };
-    enum { wPhaseIdx        = FluidSystem::wPhaseIdx};
-    enum { nPhaseIdx        = FluidSystem::nPhaseIdx};
+    enum { numComponents    = ModelTraits::numComponents() };
+    enum { phase0Idx        = FluidSystem::phase0Idx};
+    enum { phase1Idx        = FluidSystem::phase1Idx};
     enum { sPhaseIdx        = FluidSystem::sPhaseIdx};
 
 public:
-
-
     //! The energy storage in the fluid phase with index phaseIdx
     static void fluidPhaseStorage(NumEqVector& storage,
                                   const SubControlVolume& scv,
@@ -177,17 +177,17 @@ public:
         const Scalar TFluid     = volVars.temperature(0);
         const Scalar TSolid     = volVars.temperatureSolid();
 
-        const Scalar satW       = fs.saturation(wPhaseIdx) ;
-        const Scalar satN       = fs.saturation(nPhaseIdx) ;
+        const Scalar satW       = fs.saturation(phase0Idx) ;
+        const Scalar satN       = fs.saturation(phase1Idx) ;
 
         const Scalar eps = 1e-6 ;
         Scalar solidToFluidEnergyExchange ;
 
         Scalar fluidConductivity ;
             if (satW < 1.0 - eps)
-                fluidConductivity = volVars.fluidThermalConductivity(nPhaseIdx) ;
+                fluidConductivity = volVars.fluidThermalConductivity(phase1Idx) ;
             else if (satW >= 1.0 - eps)
-                fluidConductivity = volVars.fluidThermalConductivity(wPhaseIdx) ;
+                fluidConductivity = volVars.fluidThermalConductivity(phase0Idx) ;
             else
                 DUNE_THROW(Dune::NotImplemented,
                         "wrong range");
@@ -199,11 +199,11 @@ public:
 
         if (satW < (0 + eps) )
         {
-                solidToFluidEnergyExchange *=  volVars.nusseltNumber(nPhaseIdx) ;
+                solidToFluidEnergyExchange *=  volVars.nusseltNumber(phase1Idx) ;
         }
         else if ( (satW >= 0 + eps) and (satW < 1.0-eps) )
         {
-            solidToFluidEnergyExchange *=  (volVars.nusseltNumber(nPhaseIdx) * satN );
+            solidToFluidEnergyExchange *=  (volVars.nusseltNumber(phase1Idx) * satN );
             Scalar qBoil ;
             if (satW<=epsRegul)
             {// regularize
@@ -233,7 +233,7 @@ public:
         }
         else if (satW >= 1.0-eps)
         {
-            solidToFluidEnergyExchange *=  volVars.nusseltNumber(wPhaseIdx) ;
+            solidToFluidEnergyExchange *=  volVars.nusseltNumber(phase0Idx) ;
         }
         else
             DUNE_THROW(Dune::NotImplemented,
@@ -278,17 +278,17 @@ public:
         const Scalar characteristicLength   = volVars.characteristicLength()  ;
         using std::pow;
         const Scalar as = 6.0 * (1.0-volVars.porosity()) / characteristicLength ;
-        const Scalar mul = fs.viscosity(wPhaseIdx) ;
-        const Scalar deltahv = fs.enthalpy(nPhaseIdx) - fs.enthalpy(wPhaseIdx);
-        const Scalar deltaRho = fs.density(wPhaseIdx) - fs.density(nPhaseIdx) ;
+        const Scalar mul = fs.viscosity(phase0Idx) ;
+        const Scalar deltahv = fs.enthalpy(phase1Idx) - fs.enthalpy(phase0Idx);
+        const Scalar deltaRho = fs.density(phase0Idx) - fs.density(phase1Idx) ;
         const Scalar firstBracket = pow(g * deltaRho / gamma, 0.5);
-        const Scalar cp = FluidSystem::heatCapacity(fs, wPhaseIdx) ;
+        const Scalar cp = FluidSystem::heatCapacity(fs, phase0Idx) ;
         // This use of Tsat is only justified if the fluid is always boiling (tsat equals boiling conditions)
         // If a different state is to be simulated, please use the actual fluid temperature instead.
-        const Scalar Tsat = FluidSystem::vaporTemperature(fs, nPhaseIdx ) ;
+        const Scalar Tsat = FluidSystem::vaporTemperature(fs, phase1Idx ) ;
         const Scalar deltaT = TSolid - Tsat ;
         const Scalar secondBracket = pow( (cp *deltaT / (0.006 * deltahv)  ) , 3.0 ) ;
-        const Scalar Prl = volVars.prandtlNumber(wPhaseIdx) ;
+        const Scalar Prl = volVars.prandtlNumber(phase0Idx) ;
         const Scalar thirdBracket = pow( 1/Prl , (1.7/0.33) );
         const Scalar QBoil = satW * as * mul * deltahv * firstBracket * secondBracket * thirdBracket ;
             return QBoil;
@@ -318,26 +318,28 @@ class EnergyLocalResidualNonEquilibrium<TypeTag, 2 /*numEnergyEqFluid*/>
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
 
-    enum { numPhases        = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() };
-    enum { numEnergyEqFluid = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid) };
-    enum { numEnergyEqSolid = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid) };
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
+    enum { numPhases        = ModelTraits::numPhases() };
+    enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() };
+    enum { numEnergyEqSolid = ModelTraits::numEnergyEqSolid() };
     enum { energyEq0Idx = Indices::energyEq0Idx };
     enum { energyEqSolidIdx = Indices::energyEqSolidIdx};
     enum { conti0EqIdx = Indices::conti0EqIdx };
 
-    enum { numComponents    = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents() };
-    enum { wPhaseIdx        = FluidSystem::wPhaseIdx};
-    enum { nPhaseIdx        = FluidSystem::nPhaseIdx};
+    enum { numComponents    = ModelTraits::numComponents() };
+    enum { phase0Idx        = FluidSystem::phase0Idx};
+    enum { phase1Idx        = FluidSystem::phase1Idx};
     enum { sPhaseIdx        = FluidSystem::sPhaseIdx};
 
-    static constexpr bool enableChemicalNonEquilibrium = GET_PROP_TYPE(TypeTag, ModelTraits)::enableChemicalNonEquilibrium();
+    static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
 
 public:
 
@@ -416,16 +418,16 @@ public:
         const auto &localScvIdx = scv.indexInElement();
         const auto &volVars = elemVolVars[localScvIdx];
 
-        const Scalar awn = volVars.interfacialArea(wPhaseIdx, nPhaseIdx);
-        const Scalar aws = volVars.interfacialArea(wPhaseIdx, sPhaseIdx);
-        const Scalar ans = volVars.interfacialArea(nPhaseIdx, sPhaseIdx);
+        const Scalar awn = volVars.interfacialArea(phase0Idx, phase1Idx);
+        const Scalar aws = volVars.interfacialArea(phase0Idx, sPhaseIdx);
+        const Scalar ans = volVars.interfacialArea(phase1Idx, sPhaseIdx);
 
-        const Scalar Tw = volVars.temperature(wPhaseIdx);
-        const Scalar Tn = volVars.temperature(nPhaseIdx);
+        const Scalar Tw = volVars.temperature(phase0Idx);
+        const Scalar Tn = volVars.temperature(phase1Idx);
         const Scalar Ts = volVars.temperatureSolid();
 
-        const  Scalar lambdaWetting     = volVars.fluidThermalConductivity(wPhaseIdx);
-        const  Scalar lambdaNonWetting  = volVars.fluidThermalConductivity(nPhaseIdx);
+        const  Scalar lambdaWetting     = volVars.fluidThermalConductivity(phase0Idx);
+        const  Scalar lambdaNonWetting  = volVars.fluidThermalConductivity(phase1Idx);
         const  Scalar lambdaSolid       = volVars.solidThermalConductivity();
 
         const Scalar lambdaWN      = harmonicMean(lambdaWetting, lambdaNonWetting);
@@ -435,9 +437,9 @@ public:
         const Scalar characteristicLength   = volVars.characteristicLength()  ;
         const Scalar factorEnergyTransfer   = volVars.factorEnergyTransfer()  ;
 
-        const Scalar nusseltWN      = harmonicMean(volVars.nusseltNumber(wPhaseIdx), volVars.nusseltNumber(nPhaseIdx));
-        const Scalar nusseltWS      = volVars.nusseltNumber(wPhaseIdx);
-        const Scalar nusseltNS      = volVars.nusseltNumber(nPhaseIdx);
+        const Scalar nusseltWN      = harmonicMean(volVars.nusseltNumber(phase0Idx), volVars.nusseltNumber(phase1Idx));
+        const Scalar nusseltWS      = volVars.nusseltNumber(phase0Idx);
+        const Scalar nusseltNS      = volVars.nusseltNumber(phase1Idx);
 
         const Scalar wettingToNonWettingEnergyExchange = factorEnergyTransfer * (Tw - Tn) / characteristicLength * awn * lambdaWN * nusseltWN  ;
         const Scalar wettingToSolidEnergyExchange      = factorEnergyTransfer * (Tw - Ts) / characteristicLength * aws * lambdaWS * nusseltWS  ;
@@ -446,10 +448,10 @@ public:
         for(int phaseIdx =0; phaseIdx<numEnergyEqFluid+numEnergyEqSolid; ++phaseIdx){
             switch (phaseIdx)
             {
-            case wPhaseIdx:
+            case phase0Idx:
                 source[energyEq0Idx + phaseIdx] +=  ( - wettingToNonWettingEnergyExchange - wettingToSolidEnergyExchange);
                 break;
-            case nPhaseIdx:
+            case phase1Idx:
                 source[energyEq0Idx + phaseIdx] +=  (+ wettingToNonWettingEnergyExchange - nonWettingToSolidEnergyExchange);
                 break;
             case sPhaseIdx:
@@ -487,24 +489,24 @@ public:
             {
                 switch (phaseIdx)
                 {
-                case wPhaseIdx:
+                case phase0Idx:
                 //sum up the transfered energy by the components into the wetting phase
                     for(int compIdx =0; compIdx<numComponents; ++compIdx)
                     {
                         const unsigned int eqIdx = conti0EqIdx + compIdx + phaseIdx*numComponents;
                         source[energyEq0Idx + phaseIdx] += (source[eqIdx]
                                                             * FluidSystem::molarMass(compIdx)
-                                                            * FluidSystem::componentEnthalpy(fluidState, nPhaseIdx, compIdx) );
+                                                            * FluidSystem::componentEnthalpy(fluidState, phase1Idx, compIdx) );
                     }
                 break;
-                case nPhaseIdx:
+                case phase1Idx:
                 //sum up the transfered energy by the components into the nonwetting phase
                     for(int compIdx =0; compIdx<numComponents; ++compIdx)
                     {
                         const unsigned int eqIdx = conti0EqIdx + compIdx + phaseIdx*numComponents;
                         source[energyEq0Idx + phaseIdx] += (source[eqIdx]
                                                             * FluidSystem::molarMass(compIdx)
-                                                            *FluidSystem::componentEnthalpy(fluidState, wPhaseIdx, compIdx));
+                                                            *FluidSystem::componentEnthalpy(fluidState, phase0Idx, compIdx));
                     }
                     break;
                 case sPhaseIdx:
diff --git a/dumux/porousmediumflow/nonequilibrium/volumevariables.hh b/dumux/porousmediumflow/nonequilibrium/volumevariables.hh
index 162e651e295857156a49db32f40672233f6250f9..b1c113862f4c235d72316bcae0adcceebf1b3d4c 100644
--- a/dumux/porousmediumflow/nonequilibrium/volumevariables.hh
+++ b/dumux/porousmediumflow/nonequilibrium/volumevariables.hh
@@ -45,226 +45,184 @@ namespace Dumux {
  *        modules which require the specific interfacial area between
  *        fluid phases.
  */
-// forward declaration
-template <class TypeTag, bool enableChemicalNonEquilibrium ,bool enableThermalNonEquilibrium>
+template<class Traits, bool enableChemicalNonEquilibrium ,bool enableThermalNonEquilibrium>
 class NonEquilibriumVolumeVariablesImplementation;
 
-template <class TypeTag>
+template<class Traits>
 using NonEquilibriumVolumeVariables =
-NonEquilibriumVolumeVariablesImplementation<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableChemicalNonEquilibrium(), GET_PROP_TYPE(TypeTag, ModelTraits)::enableThermalNonEquilibrium()>;
-
-template <class TypeTag>
-class NonEquilibriumVolumeVariablesImplementation<TypeTag, false/*enableChemicalNonEquilibrium*/, false/*enableThermalNonEquilibrium*/>
+      NonEquilibriumVolumeVariablesImplementation< Traits,
+                                                   Traits::ModelTraits::enableChemicalNonEquilibrium(),
+                                                   Traits::ModelTraits::enableThermalNonEquilibrium() >;
+
+//! Specialization for both chemical and thermal non-equilibrium disabled
+template<class Traits>
+class NonEquilibriumVolumeVariablesImplementation< Traits,
+                                                   false/*chemicalNonEquilibrium?*/,
+                                                   false/*thermalNonEquilibrium?*/ >
 {
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-    using FVElementGeometry = typename FVGridGeometry::LocalView;
-    using SubControlVolume = typename FVGridGeometry::SubControlVolume;
-    using Element = typename GridView::template Codim<0>::Entity;
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-    using ParameterCache = typename FluidSystem::ParameterCache;
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FluidState = typename Traits::FluidState;
+    using ParameterCache = typename Traits::FluidSystem::ParameterCache;
+
 public:
-    template<class ElementSolution>
-    void updateInterfacialArea(const ElementSolution& elemSol,
-                               const FluidState & fluidState,
-                               const ParameterCache &paramCache,
-                               const Problem &problem,
-                               const Element & element,
-                               const SubControlVolume& scv)
-    {}
-
-    template<class ElementSolution>
-    void updateTemperatures(const ElementSolution& elemSol,
-                             const Problem &problem,
-                             const Element& element,
-                             const SubControlVolume& scv,
-                             FluidState& fluidState)
-    {}
-
-
-    void updateMoleFraction(FluidState & actualFluidState,
-                            ParameterCache & paramCache,
-                            const PrimaryVariables & priVars)
-    {}
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateInterfacialArea(const ElemSol& elemSol,
+                               const FluidState& fluidState,
+                               const ParameterCache& paramCache,
+                               const Problem& problem,
+                               const Element& element,
+                               const Scv& scv) {}
+
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateTemperatures(const ElemSol& elemSol,
+                            const Problem &problem,
+                            const Element& element,
+                            const Scv& scv,
+                            FluidState& fluidState) {}
 
+    void updateMoleFraction(FluidState& actualFluidState,
+                            ParameterCache& paramCache,
+                            const typename Traits::PrimaryVariables& priVars) {}
 };
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// // specialization for the case of NO kinetic mass but kinetic energy transfer of a fluid mixture and solid
-// /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-template <class TypeTag>
-class NonEquilibriumVolumeVariablesImplementation<TypeTag, /*enableChemicalNonEquilibrium*/false, /*enableThermalNonEquilibrium*/true>
+// specialization for the case of NO kinetic mass but kinetic energy transfer of a fluid mixture and solid
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+template<class Traits>
+class NonEquilibriumVolumeVariablesImplementation< Traits,
+                                                   false/*chemicalNonEquilibrium?*/,
+                                                   true/*thermalNonEquilibrium?*/ >
 {
-    using BaseType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using Element = typename GridView::template Codim<0>::Entity;
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-    using ParameterCache = typename FluidSystem::ParameterCache;
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-
-    enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() };
-    enum { nusseltFormulation = GET_PROP_VALUE(TypeTag, NusseltFormulation)} ;
-    enum { numEnergyEqFluid = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid) };
-    enum { numEnergyEqSolid = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid) };
-    enum { temperature0Idx = Indices::temperature0Idx };
-
-    static_assert((numEnergyEqFluid < 2),
-                   "This model is a specialization for a energy transfer of a fluid  mixture and a solid");
+    using FluidState = typename Traits::FluidState;
+    using ParameterCache = typename Traits::FluidSystem::ParameterCache;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+
+    using ModelTraits = typename Traits::ModelTraits;
+    using Indices = typename ModelTraits::Indices;
+    static constexpr auto numPhases = ModelTraits::numPhases();
+    static constexpr auto numEnergyEqFluid = ModelTraits::numEnergyEqFluid();
+    static constexpr auto numEnergyEqSolid = ModelTraits::numEnergyEqSolid();
+
+    static_assert((numEnergyEqFluid < 2), "This model is a specialization for a energy transfer of a fluid mixture and a solid");
 
     using DimLessNum = DimensionlessNumbers<Scalar>;
+
 public:
     /*!
      * \brief Updates the volume specific interfacial area [m^2 / m^3] between the phases.
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param fluidState Container for all the secondary variables concerning the fluids
+     * \param paramCache The parameter cache corresponding to the fluid state
+     * \param problem The problem to be solved
+     * \param element An element which contains part of the control volume
+     * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void updateInterfacialArea(const ElementSolution& elemSol,
-                               const FluidState & fluidState,
-                               const ParameterCache &paramCache,
-                               const Problem &problem,
-                               const Element & element,
-                               const SubControlVolume& scv)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateInterfacialArea(const ElemSol& elemSol,
+                               const FluidState& fluidState,
+                               const ParameterCache& paramCache,
+                               const Problem& problem,
+                               const Element& element,
+                               const Scv& scv)
     {
-        factorMassTransfer_   = problem.spatialParams().factorMassTransfer(element, scv, elemSol);
-        factorEnergyTransfer_   = problem.spatialParams().factorEnergyTransfer(element, scv, elemSol);
-        characteristicLength_   = problem.spatialParams().characteristicLength(element, scv, elemSol);
+        factorMassTransfer_  = problem.spatialParams().factorMassTransfer(element, scv, elemSol);
+        factorEnergyTransfer_ = problem.spatialParams().factorEnergyTransfer(element, scv, elemSol);
+        characteristicLength_ = problem.spatialParams().characteristicLength(element, scv, elemSol);
 
-        // setting the dimensionless numbers.
-        // obtaining the respective quantities.
-         const unsigned int vIdxGlobal = scv.dofIndex();
+        // set the dimensionless numbers and obtain respective quantities
+        const unsigned int vIdxGlobal = scv.dofIndex();
         for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
         {
-            const Scalar darcyMagVelocity     = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, vIdxGlobal);
-            const Scalar dynamicViscosity     = fluidState.viscosity(phaseIdx);
-            const Scalar density              = fluidState.density(phaseIdx);
-            const Scalar kinematicViscosity   = dynamicViscosity / density;
-            const Scalar heatCapacity         = FluidSystem::heatCapacity(fluidState,
-                                                                          paramCache,
-                                                                          phaseIdx);
-            const Scalar thermalConductivity  = FluidSystem::thermalConductivity(fluidState,
-                                                                           paramCache,
-                                                                           phaseIdx);
-            const Scalar porosity = problem.spatialParams().porosity(element,
-                                                                   scv,
-                                                                   elemSol);
-
-            reynoldsNumber_[phaseIdx]   = DimLessNum::reynoldsNumber(darcyMagVelocity,
-                                                                     characteristicLength_,
-                                                                     kinematicViscosity);
-
-            prandtlNumber_[phaseIdx]    = DimLessNum::prandtlNumber(dynamicViscosity,
-                                                                    heatCapacity,
-                                                                    thermalConductivity);
-
-
-            nusseltNumber_[phaseIdx]    = DimLessNum::nusseltNumberForced(reynoldsNumber_[phaseIdx],
-                                                                          prandtlNumber_[phaseIdx],
-                                                                          porosity,
-                                                                          nusseltFormulation);
+            const auto darcyMagVelocity     = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, vIdxGlobal);
+            const auto dynamicViscosity     = fluidState.viscosity(phaseIdx);
+            const auto density              = fluidState.density(phaseIdx);
+            const auto kinematicViscosity   = dynamicViscosity/density;
+
+            using FluidSystem = typename Traits::FluidSystem;
+            const auto heatCapacity        = FluidSystem::heatCapacity(fluidState, paramCache, phaseIdx);
+            const auto thermalConductivity = FluidSystem::thermalConductivity(fluidState, paramCache, phaseIdx);
+            const auto porosity            = problem.spatialParams().porosity(element, scv, elemSol);
+
+            reynoldsNumber_[phaseIdx] = DimLessNum::reynoldsNumber(darcyMagVelocity, characteristicLength_, kinematicViscosity);
+            prandtlNumber_[phaseIdx]  = DimLessNum::prandtlNumber(dynamicViscosity, heatCapacity, thermalConductivity);
+            nusseltNumber_[phaseIdx]  = DimLessNum::nusseltNumberForced(reynoldsNumber_[phaseIdx],
+                                                                        prandtlNumber_[phaseIdx],
+                                                                        porosity,
+                                                                        ModelTraits::nusseltFormulation());
         }
     }
 
     /*!
-     * \brief Update all quantities for a given control volume
+     * \brief Update the temperatures for a given control volume
      *
      * \param elemSol A vector containing all primary variables connected to the element
+     * \param problem The problem to be solved
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
+     * \param fluidState Container for all the secondary variables concerning the fluids
      */
-    template<class ElementSolution>
-    void updateTemperatures(const ElementSolution& elemSol,
-                            const Problem &problem,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateTemperatures(const ElemSol& elemSol,
+                            const Problem& problem,
                             const Element& element,
-                            const SubControlVolume& scv,
+                            const Scv& scv,
                             FluidState& fluidState)
     {
-        if (numEnergyEqFluid >1)
-        for(int phaseIdx=0; phaseIdx < numEnergyEqFluid; ++phaseIdx)
+        // set fluid temperature(s)
+        if (numEnergyEqFluid > 1)
         {
             // retrieve temperature from solution vector
-            const Scalar T = BaseType::extractDofPriVars(elemSol, scv)[temperature0Idx + phaseIdx];
-            fluidState.setTemperature(phaseIdx, T);
+            for(int phaseIdx=0; phaseIdx < numEnergyEqFluid; ++phaseIdx)
+            {
+                const auto T = elemSol[scv.indexInElement()][Indices::temperature0Idx + phaseIdx];
+                fluidState.setTemperature(phaseIdx, T);
+            }
         }
         else
         {
-            const Scalar T = BaseType::extractDofPriVars(elemSol, scv)[temperature0Idx];
+            const auto T = elemSol[scv.indexInElement()][Indices::temperature0Idx];
             fluidState.setTemperature(T);
         }
-        for(int solidPhaseIdx = numEnergyEqFluid; solidPhaseIdx < numEnergyEqFluid+numEnergyEqSolid; ++solidPhaseIdx)
-        {
-            temperatureSolid_ = BaseType::extractDofPriVars(elemSol, scv)[temperature0Idx + solidPhaseIdx];
 
-        }
+        // set solid temperatures
+        static_assert(numEnergyEqSolid == 1, "Solid system not yet implemented");
+        for (int solidPhaseIdx = numEnergyEqFluid; solidPhaseIdx < numEnergyEqFluid+numEnergyEqSolid; ++solidPhaseIdx)
+            temperatureSolid_ = elemSol[scv.indexInElement()][Indices::temperature0Idx + solidPhaseIdx];
     }
 
-    void updateMoleFraction(FluidState & actualFluidState,
-                            ParameterCache & paramCache,
-                            const PrimaryVariables & priVars)
-    { }
-
-
     /*!
-     * \brief Returns the temperature in fluid / solid phase(s)
-     *        the sub-control volume.
-     * \param phaseIdx The local index of the phases
+     * \brief Update composition of all phases in the mutable parameters from the primary variables.
+     *
+     *  \param actualFluidState Container for all the secondary variables concerning the fluids
+     *  \param paramCache Container for cache parameters
+     *  \param priVars The primary Variables
      */
-    Scalar temperatureSolid() const
-    { return temperatureSolid_; }
+    void updateMoleFraction(FluidState& actualFluidState,
+                            ParameterCache& paramCache,
+                            const typename Traits::PrimaryVariables& priVars) {}
 
-    //! access function Reynolds Number
-    const Scalar reynoldsNumber(const unsigned int phaseIdx) const
-    { return reynoldsNumber_[phaseIdx]; }
 
+    //! Returns the temperature of the solid phase(s)
+    Scalar temperatureSolid() const { return temperatureSolid_; }
+    //! access function Reynolds Number
+    const Scalar reynoldsNumber(const unsigned int phaseIdx) const { return reynoldsNumber_[phaseIdx]; }
     //! access function Prandtl Number
-    const Scalar prandtlNumber(const unsigned int phaseIdx) const
-    { return prandtlNumber_[phaseIdx]; }
-
+    const Scalar prandtlNumber(const unsigned int phaseIdx) const { return prandtlNumber_[phaseIdx]; }
     //! access function Nusselt Number
-    const Scalar nusseltNumber(const unsigned int phaseIdx) const
-    { return nusseltNumber_[phaseIdx]; }
-
+    const Scalar nusseltNumber(const unsigned int phaseIdx) const { return nusseltNumber_[phaseIdx]; }
     //! access function characteristic length
-    const Scalar characteristicLength() const
-    { return characteristicLength_; }
-
+    const Scalar characteristicLength() const { return characteristicLength_; }
     //! access function pre factor energy transfer
-    const Scalar factorEnergyTransfer() const
-    { return factorEnergyTransfer_; }
-
+    const Scalar factorEnergyTransfer() const { return factorEnergyTransfer_; }
     //! access function pre factor mass transfer
-    const Scalar factorMassTransfer() const
-    { return factorMassTransfer_; }
-
-    /*!
-     * \brief If running in valgrind this makes sure that all
-     *        quantities in the volume variables are defined.
-     */
-    void checkDefined() const
-    {
-#if !defined NDEBUG && HAVE_VALGRIND
-        Valgrind::CheckDefined(reynoldsNumber_);
-        Valgrind::CheckDefined(prandtlNumber_);
-        Valgrind::CheckDefined(nusseltNumber_);
-        Valgrind::CheckDefined(characteristicLength_);
-        Valgrind::CheckDefined(factorEnergyTransfer_);
-        Valgrind::CheckDefined(factorMassTransfer_);
-        Valgrind::CheckDefined(temperatureSolid_);
-#endif
-    }
+    const Scalar factorMassTransfer() const { return factorMassTransfer_; }
 
 private:
     //! dimensionless numbers
     Scalar reynoldsNumber_[numPhases];
     Scalar prandtlNumber_[numPhases];
     Scalar nusseltNumber_[numPhases];
+
     Scalar characteristicLength_;
     Scalar factorEnergyTransfer_;
     Scalar factorMassTransfer_;
@@ -273,166 +231,139 @@ private:
 };
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-// // specialization for the case of (only) kinetic mass transfer. Be careful, we do not test this!
-// ////////////////////////////////////////////////////////////////////////////////////////////////////
-template <class TypeTag>
-class NonEquilibriumVolumeVariablesImplementation<TypeTag, true/*enableChemicalNonEquilibrium*/, false/*enableThermalNonEquilibrium*/>
+// specialization for the case of (only) kinetic mass transfer. Be careful, we do not test this!
+////////////////////////////////////////////////////////////////////////////////////////////////////
+template<class Traits>
+class NonEquilibriumVolumeVariablesImplementation< Traits,
+                                                   true/*chemicalNonEquilibrium?*/,
+                                                   false/*thermalNonEquilibrium?*/>
 {
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using Element = typename GridView::template Codim<0>::Entity;
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-    using ParameterCache = typename FluidSystem::ParameterCache;
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-
-    enum { numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents() };
-    enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() };
-    enum { wPhaseIdx = FluidSystem::wPhaseIdx };
-    enum { nPhaseIdx = FluidSystem::nPhaseIdx };
-    enum { nCompIdx = FluidSystem::nCompIdx } ;
-    enum { wCompIdx = FluidSystem::wCompIdx } ;
-    enum { dim = GridView::dimension};
-    enum { sherwoodFormulation = GET_PROP_VALUE(TypeTag, SherwoodFormulation)} ;
-    enum { moleFrac00Idx = Indices::conti0EqIdx };
-
-    using AwnSurface = typename GET_PROP_TYPE(TypeTag, AwnSurface);
-    using AwnSurfaceParams = typename  AwnSurface::Params;
+    using FluidState = typename Traits::FluidState;
+    using FluidSystem = typename Traits::FluidSystem;
+    using ParameterCache = typename Traits::FluidSystem::ParameterCache;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+
+    using ModelTraits = typename Traits::ModelTraits;
+    using Indices = typename ModelTraits::Indices;
+    static constexpr auto numPhases = ModelTraits::numPhases();
+    static constexpr auto numComponents = ModelTraits::numComponents();
+
+    static constexpr auto phase0Idx = FluidSystem::phase0Idx;
+    static constexpr auto phase1Idx = FluidSystem::phase1Idx;
+    static constexpr auto wCompIdx = FluidSystem::comp0Idx;
+    static constexpr auto nCompIdx = FluidSystem::comp1Idx;
 
     using DimLessNum = DimensionlessNumbers<Scalar>;
     using ConstraintSolver = MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
+
 public:
     /*!
      * \brief Updates the volume specific interfacial area [m^2 / m^3] between the phases.
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param fluidState Container for all the secondary variables concerning the fluids
+     * \param paramCache The parameter cache corresponding to the fluid state
+     * \param problem The problem to be solved
+     * \param element An element which contains part of the control volume
+     * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void updateInterfacialArea(const ElementSolution& elemSol,
-                               const FluidState & fluidState,
-                               const ParameterCache &paramCache,
-                               const Problem &problem,
-                               const Element & element,
-                               const SubControlVolume& scv)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateInterfacialArea(const ElemSol& elemSol,
+                               const FluidState& fluidState,
+                               const ParameterCache& paramCache,
+                               const Problem& problem,
+                               const Element& element,
+                               const Scv& scv)
     {
-        //obtain parameters for awnsurface
-        const AwnSurfaceParams & awnSurfaceParams = problem.spatialParams().aWettingNonWettingSurfaceParams(element, scv, elemSol) ;
-
-        // obtain (standard) material parameters (needed for the residual saturations)
-        const auto &materialParams  = problem.spatialParams().materialLawParams(element, scv, elemSol) ;
+        // obtain parameters for awnsurface and material law
+        const auto& awnSurfaceParams = problem.spatialParams().aWettingNonWettingSurfaceParams(element, scv, elemSol) ;
+        const auto& materialParams  = problem.spatialParams().materialLawParams(element, scv, elemSol) ;
 
-        Valgrind::CheckDefined(awnSurfaceParams);
-        const Scalar Sw = fluidState.saturation(wPhaseIdx) ;
-        const Scalar pc = fluidState.pressure(nPhaseIdx) - fluidState.pressure(wPhaseIdx);
+        const auto Sw = fluidState.saturation(phase0Idx) ;
+        const auto pc = fluidState.pressure(phase1Idx) - fluidState.pressure(phase0Idx);
 
         // so far there is only a model for kinetic mass transfer between fluid phases
-        interfacialArea_ = AwnSurface::interfacialArea(awnSurfaceParams, materialParams, Sw, pc );
+        using AwnSurface = typename Problem::SpatialParams::AwnSurface;
+        interfacialArea_ = AwnSurface::interfacialArea(awnSurfaceParams, materialParams, Sw, pc);
 
-        Valgrind::CheckDefined(interfacialArea_);
+        factorMassTransfer_ = problem.spatialParams().factorMassTransfer(element, scv, elemSol);
+        characteristicLength_ = problem.spatialParams().characteristicLength(element, scv, elemSol);
 
-        factorMassTransfer_   = problem.spatialParams().factorMassTransfer(element, scv, elemSol);
-
-        characteristicLength_   = problem.spatialParams().characteristicLength(element, scv, elemSol);
-        // setting the dimensionless numbers.
-        // obtaining the respective quantities.
-        int globalVertexIdx = problem.vertexMapper().subIndex(element, scv, dim);
+        // set the dimensionless numbers and obtain respective quantities.
+        const auto globalVertexIdx = problem.fvGridGeometry().vertexMapper().subIndex(element, scv, Element::Geometry::myDimension);
         for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
         {
-            const Scalar darcyMagVelocity     = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, globalVertexIdx);
-            const Scalar dynamicViscosity     = fluidState.viscosity(phaseIdx);
-            const Scalar density              = fluidState.density(phaseIdx);
-            const Scalar kinematicViscosity   = dynamicViscosity / density;
+            const auto darcyMagVelocity     = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, globalVertexIdx);
+            const auto dynamicViscosity     = fluidState.viscosity(phaseIdx);
+            const auto density              = fluidState.density(phaseIdx);
+            const auto kinematicViscosity   = dynamicViscosity/density;
 
             // diffusion coefficient of non-wetting component in wetting phase
-            const Scalar diffCoeff = FluidSystem::binaryDiffusionCoefficient(fluidState, paramCache, phaseIdx, wCompIdx, nCompIdx);
-
-            reynoldsNumber_[phaseIdx]   = DimLessNum::reynoldsNumber(darcyMagVelocity,
-                                                                     characteristicLength_,
-                                                                     kinematicViscosity);
-
-            schmidtNumber_[phaseIdx]    = DimLessNum::schmidtNumber(dynamicViscosity,
-                                                                    density,
-                                                                    diffCoeff);
-            sherwoodNumber_[phaseIdx]   = DimLessNum::sherwoodNumber(reynoldsNumber_[phaseIdx],
-                                                                     schmidtNumber_[phaseIdx],
-                                                                     sherwoodFormulation);
+            const auto diffCoeff = FluidSystem::binaryDiffusionCoefficient(fluidState,
+                                                                           paramCache,
+                                                                           phaseIdx,
+                                                                           wCompIdx,
+                                                                           nCompIdx);
+
+            reynoldsNumber_[phaseIdx] = DimLessNum::reynoldsNumber(darcyMagVelocity, characteristicLength_, kinematicViscosity);
+            schmidtNumber_[phaseIdx]  = DimLessNum::schmidtNumber(dynamicViscosity, density, diffCoeff);
+            sherwoodNumber_[phaseIdx] = DimLessNum::sherwoodNumber(reynoldsNumber_[phaseIdx],
+                                                                   schmidtNumber_[phaseIdx],
+                                                                   ModelTraits::sherwoodFormulation());
         }
     }
 
-     /*!
-     * \brief Update composition of all phases in the mutable
-     *        parameters from the primary variables.
+    /*!
+     * \brief Update composition of all phases in the mutable parameters from the primary variables.
      *
-     *        \param actualFluidState Container for all the secondary variables concerning the fluids
-     *        \param paramCache Container for cache parameters
-     *        \param priVars The primary Variables
-     *        \param *hint the volume variables, usable for initial guess of composition
+     *  \param actualFluidState Container for all the secondary variables concerning the fluids
+     *  \param paramCache Container for cache parameters
+     *  \param priVars The primary Variables
      */
-    void updateMoleFraction(FluidState & actualFluidState,
-                            ParameterCache & paramCache,
-                            const PrimaryVariables & priVars)
+    void updateMoleFraction(FluidState& actualFluidState,
+                            ParameterCache& paramCache,
+                            const typename Traits::PrimaryVariables& priVars)
     {
-        // setting the mole fractions of the fluid state
+        // set the mole fractions of the fluid state
+        for(int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            for (int compIdx = 0; compIdx < numComponents; ++compIdx)
+                actualFluidState.setMoleFraction( phaseIdx,
+                                                  compIdx,
+                                                  priVars[Indices::conti0EqIdx+phaseIdx*numComponents+compIdx] );
+
+        // For using the ... other way of calculating equilibrium
         for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx)
-        {
-                // set the component mole fractions
-                for (int compIdx = 0; compIdx < numComponents; ++compIdx) {
-                    actualFluidState.setMoleFraction(phaseIdx,
-                           compIdx,
-                           priVars[moleFrac00Idx +
-                                   phaseIdx*numComponents +
-                                   compIdx]);
-                }
-        }
-
-//          // For using the ... other way of calculating equilibrium
-//          THIS IS ONLY FOR silencing Valgrind but is not used in this model
-            for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx)
-                for (int compIdx = 0; compIdx < numComponents; ++compIdx) {
-                    const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
-                                                                        paramCache,
-                                                                        phaseIdx,
-                                                                        compIdx);
-                    actualFluidState.setFugacityCoefficient(phaseIdx,
-                                                      compIdx,
-                                                      phi);
-            }
-
-            FluidState equilFluidState; // the fluidState *on the interface* i.e. chemical equilibrium
-            equilFluidState.assign(actualFluidState) ;
-            ConstraintSolver::solve(equilFluidState,
-                                    paramCache,
-                                    /*setViscosity=*/false,
-                                    /*setEnthalpy=*/false) ;
-
-            // Setting the equilibrium composition (in a kinetic model not necessarily the same as the actual mole fraction)
-            for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx){
-                for (int compIdx=0; compIdx< numComponents; ++ compIdx){
-                    xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
-                }
-            }
-
-            // compute densities of all phases
-            for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx){
-                const Scalar rho = FluidSystem::density(actualFluidState, paramCache, phaseIdx);
-                actualFluidState.setDensity(phaseIdx, rho);
-            }
-
-        }
+            for (int compIdx = 0; compIdx < numComponents; ++compIdx)
+                actualFluidState.setFugacityCoefficient( phaseIdx,
+                                                         compIdx,
+                                                         FluidSystem::fugacityCoefficient(actualFluidState,
+                                                                                          paramCache,
+                                                                                          phaseIdx,
+                                                                                          compIdx) );
+
+        FluidState equilFluidState; // the fluidState *on the interface* i.e. chemical equilibrium
+        equilFluidState.assign(actualFluidState) ;
+        ConstraintSolver::solve(equilFluidState, paramCache, /*setViscosity=*/false, /*setEnthalpy=*/false);
+
+        // Set the equilibrium composition (in a kinetic model not necessarily the same as the actual mole fraction)
+        for(int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            for (int compIdx = 0; compIdx < numComponents; ++ compIdx)
+                xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
+
+        // compute densities of all phases
+        for(int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            actualFluidState.setDensity(phaseIdx, FluidSystem::density(actualFluidState, paramCache, phaseIdx));
+    }
 
     /*!
-     * \brief The mole fraction we would have in the case of chemical equilibrium /
+     * \brief The mole fraction we would have in the case of chemical equilibrium
      *        on the interface.
      *
-     *     \param phaseIdx The index of the fluid phase
-     *     \param compIdx The local index of the component
+     * \param phaseIdx The index of the fluid phase
+     * \param compIdx The local index of the component
      */
     const Scalar xEquil(const unsigned int phaseIdx, const unsigned int compIdx) const
-    {
-        return xEquil_[phaseIdx][compIdx] ;
-    }
+    { return xEquil_[phaseIdx][compIdx]; }
 
     /*!
      * \brief The specific interfacial area between two fluid phases [m^2 / m^3]
@@ -440,44 +371,21 @@ public:
     const Scalar interfacialArea(const unsigned int phaseIIdx, const unsigned int phaseJIdx) const
     {
         // so far there is only a model for kinetic mass transfer between fluid phases
-        assert((phaseIIdx == nPhaseIdx && phaseJIdx == wPhaseIdx)
-              || (phaseIIdx == wPhaseIdx && phaseJIdx == nPhaseIdx));
+        assert( (phaseIIdx == phase1Idx && phaseJIdx == phase0Idx)
+                || (phaseIIdx == phase0Idx && phaseJIdx == phase1Idx) );
         return interfacialArea_;
     }
 
     //! access function Reynolds Number
-    const Scalar reynoldsNumber(const unsigned int phaseIdx) const
-    { return reynoldsNumber_[phaseIdx]; }
-
+    const Scalar reynoldsNumber(const unsigned int phaseIdx) const { return reynoldsNumber_[phaseIdx]; }
     //! access function Schmidt Number
-    const Scalar schmidtNumber(const unsigned int phaseIdx) const
-    { return schmidtNumber_[phaseIdx]; }
-
+    const Scalar schmidtNumber(const unsigned int phaseIdx) const { return schmidtNumber_[phaseIdx]; }
     //! access function Sherwood Number
-    const Scalar sherwoodNumber(const unsigned int phaseIdx) const
-    { return sherwoodNumber_[phaseIdx]; }
-
+    const Scalar sherwoodNumber(const unsigned int phaseIdx) const { return sherwoodNumber_[phaseIdx]; }
     //! access function characteristic length
-    const Scalar characteristicLength() const
-    { return characteristicLength_; }
-
+    const Scalar characteristicLength() const { return characteristicLength_; }
     //! access function pre factor mass transfer
-    const Scalar factorMassTransfer() const
-    { return factorMassTransfer_; }
-
-    /*!
-     * \brief If running in valgrind this makes sure that all
-     *        quantities in the volume variables are defined.
-     */
-    void checkDefined() const
-    {
-        Valgrind::CheckDefined(interfacialArea_);
-        Valgrind::CheckDefined(characteristicLength_);
-        Valgrind::CheckDefined(factorMassTransfer_);
-        Valgrind::CheckDefined(reynoldsNumber_);
-        Valgrind::CheckDefined(schmidtNumber_);
-        Valgrind::CheckDefined(sherwoodNumber_);
-    }
+    const Scalar factorMassTransfer() const { return factorMassTransfer_; }
 
 private:
     Scalar characteristicLength_;
@@ -490,282 +398,235 @@ private:
     Scalar xEquil_[numPhases][numComponents];
 };
 
-//this is a specialization where everything is in non-equilibrium. we have to do our own stuff for the interfacial area but can use the rest from the others
-template <class TypeTag>
-class NonEquilibriumVolumeVariablesImplementation<TypeTag, true/*enableChemicalNonEquilibrium*/, true/*enableThermalNonEquilibrium*/>
+// Specialization where everything is in non-equilibrium.
+template<class Traits>
+class NonEquilibriumVolumeVariablesImplementation< Traits,
+                                                   true/*chemicalNonEquilibrium?*/,
+                                                   true/*thermalNonEquilibrium?*/>
 {
-    using BaseType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using Element = typename GridView::template Codim<0>::Entity;
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-    using ParameterCache = typename FluidSystem::ParameterCache;
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-
-    enum { numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents() };
-    enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() };
-    enum { wPhaseIdx = FluidSystem::wPhaseIdx };
-    enum { nPhaseIdx = FluidSystem::nPhaseIdx };
-    enum { sPhaseIdx = FluidSystem::sPhaseIdx };
-    enum { nCompIdx = FluidSystem::nCompIdx } ;
-    enum { wCompIdx = FluidSystem::wCompIdx } ;
-    enum { nusseltFormulation = GET_PROP_VALUE(TypeTag, NusseltFormulation)} ;
-    enum { sherwoodFormulation = GET_PROP_VALUE(TypeTag, SherwoodFormulation)} ;
-    enum { numEnergyEqFluid = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid) };
-    enum { numEnergyEqSolid = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid) };
-    enum { temperature0Idx = Indices::temperature0Idx };
-    enum { moleFrac00Idx = Indices::conti0EqIdx };
-
-    static_assert((numEnergyEqFluid > 1),
-                   "This model only deals with energy transfer between two fluids and one solid phase");
-    using DimLessNum = DimensionlessNumbers<Scalar>;
-
-    using AwnSurface = typename GET_PROP_TYPE(TypeTag, AwnSurface);
-    using AwnSurfaceParams = typename  AwnSurface::Params;
-    using AwsSurface = typename GET_PROP_TYPE(TypeTag, AwsSurface);
-    using AwsSurfaceParams = typename  AwsSurface::Params;
-    using AnsSurface = typename GET_PROP_TYPE(TypeTag, AnsSurface);
-    using AnsSurfaceParams = typename  AnsSurface::Params;
+    using FluidState = typename Traits::FluidState;
+    using FluidSystem = typename Traits::FluidSystem;
+    using ParameterCache = typename Traits::FluidSystem::ParameterCache;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+
+    using ModelTraits = typename Traits::ModelTraits;
+    using Indices = typename ModelTraits::Indices;
+    static constexpr auto numPhases = ModelTraits::numPhases();
+    static constexpr auto numComponents = ModelTraits::numComponents();
+    static constexpr auto numEnergyEqFluid = ModelTraits::numEnergyEqFluid();
+    static constexpr auto numEnergyEqSolid = ModelTraits::numEnergyEqSolid();
+
+    static constexpr auto phase0Idx = FluidSystem::phase0Idx;
+    static constexpr auto phase1Idx = FluidSystem::phase1Idx;
+    static constexpr auto sPhaseIdx = FluidSystem::sPhaseIdx;
+    static constexpr auto wCompIdx = FluidSystem::comp0Idx;
+    static constexpr auto nCompIdx = FluidSystem::comp1Idx;
 
+    using DimLessNum = DimensionlessNumbers<Scalar>;
     using ConstraintSolver = MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
-
+    static_assert((numEnergyEqFluid > 1), "This model only deals with energy transfer between two fluids and one solid phase");
 
 public:
     /*!
      * \brief Updates the volume specific interfacial area [m^2 / m^3] between the phases.
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param fluidState Container for all the secondary variables concerning the fluids
+     * \param paramCache The parameter cache corresponding to the fluid state
+     * \param problem The problem to be solved
+     * \param element An element which contains part of the control volume
+     * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void updateInterfacialArea(const ElementSolution& elemSol,
-                                const FluidState & fluidState,
-                                const ParameterCache &paramCache,
-                                const Problem &problem,
-                                const Element & element,
-                                const SubControlVolume& scv)
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateInterfacialArea(const ElemSol& elemSol,
+                               const FluidState& fluidState,
+                               const ParameterCache& paramCache,
+                               const Problem& problem,
+                               const Element& element,
+                               const Scv& scv)
     {
         // obtain (standard) material parameters (needed for the residual saturations)
-       const auto& materialParams =
-            problem.spatialParams().materialLawParams(element, scv, elemSol);
+       const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
 
         //obtain parameters for interfacial area constitutive relations
-        const AwnSurfaceParams & aWettingNonWettingSurfaceParams
-               = problem.spatialParams().aWettingNonWettingSurfaceParams(element, scv, elemSol);
-        const AnsSurfaceParams & aNonWettingSolidSurfaceParams
-               = problem.spatialParams().aNonWettingSolidSurfaceParams(element, scv, elemSol);
-
-        Valgrind::CheckDefined(aWettingNonWettingSurfaceParams);
-        Valgrind::CheckDefined(aNonWettingSolidSurfaceParams);
-
-        const Scalar pc = fluidState.pressure(nPhaseIdx) - fluidState.pressure(wPhaseIdx);
-        const Scalar Sw = fluidState.saturation(wPhaseIdx);
-        Valgrind::CheckDefined(Sw);
-        Valgrind::CheckDefined(pc);
+        const auto& aWettingNonWettingSurfaceParams = problem.spatialParams().aWettingNonWettingSurfaceParams(element, scv, elemSol);
+        const auto& aNonWettingSolidSurfaceParams = problem.spatialParams().aNonWettingSolidSurfaceParams(element, scv, elemSol);
+
+        const Scalar pc = fluidState.pressure(phase1Idx) - fluidState.pressure(phase0Idx);
+        const Scalar Sw = fluidState.saturation(phase0Idx);
+
         Scalar awn;
 
+        // TODO can we delete this??? awn is overwritten anyway!
 #define AwnRegul 0
         // This regularizes the interfacial area between the fluid phases.
         // This makes sure, that
         // a) some saturation cannot be lost: Never leave two phase region.
         // b) We cannot leave the fit region: no crazy (e.g. negative) values possible
-//        const Scalar Swr =  aWettingNonWettingSurfaceParams.Swr() ;
-//        const Scalar Snr =  aWettingNonWettingSurfaceParams.Snr() ;
+
+        // const Scalar Swr =  aWettingNonWettingSurfaceParams.Swr() ;
+        // const Scalar Snr =  aWettingNonWettingSurfaceParams.Snr() ;
 
         // this just leads to a stalling newton error as soon as this kicks in.
         // May be a spline or sth like this would help, but I do not which derivatives
         // to specify.
 #if AwnRegul
         if(Sw < 5e-3 ) // or Sw > (1.-1e-5 )
-        {
             awn = 0. ; // 10.; //
-        }
-        else
 #endif
-        awn = AwnSurface::interfacialArea(aWettingNonWettingSurfaceParams, materialParams, Sw, pc ); // 10.; //
 
-        interfacialArea_[wPhaseIdx][nPhaseIdx] = awn ; //10. ;//
-        interfacialArea_[nPhaseIdx][wPhaseIdx] = interfacialArea_[wPhaseIdx][nPhaseIdx];
-        interfacialArea_[wPhaseIdx][wPhaseIdx] = 0. ;
+        using AwnSurface = typename Problem::SpatialParams::AwnSurface;
+        awn = AwnSurface::interfacialArea(aWettingNonWettingSurfaceParams, materialParams, Sw, pc );
+        interfacialArea_[phase0Idx][phase1Idx] = awn;
+        interfacialArea_[phase1Idx][phase0Idx] = interfacialArea_[phase0Idx][phase1Idx];
+        interfacialArea_[phase0Idx][phase0Idx] = 0.;
 
-        Scalar ans = AnsSurface::interfacialArea(aNonWettingSolidSurfaceParams, materialParams,Sw, pc ); // 10.; //
-//        if (ans <0 )
-//            ans = 0 ;
+        using AnsSurface = typename Problem::SpatialParams::AnsSurface;
+        Scalar ans = AnsSurface::interfacialArea(aNonWettingSolidSurfaceParams, materialParams,Sw, pc);
 
-// Switch for using a a_{wn} relations that has some "maximum capillary pressure" as parameter.
-// That value is obtained by regularization of the pc(Sw) function.
+        // Switch for using a a_{wn} relations that has some "maximum capillary pressure" as parameter.
+        // That value is obtained by regularization of the pc(Sw) function.
 #if USE_PCMAX
-       const Scalar pcMax = problem.spatialParams().pcMax(element,
-                                                          scv,
-                                                          elemSol);
+        const Scalar pcMax = problem.spatialParams().pcMax(element, scv, elemSol);
         // I know the solid surface from the pore network. But it is more consistent to use the fit value.
-        solidSurface_   = AnsSurface::interfacialArea(aNonWettingSolidSurfaceParams, materialParams, /*Sw=*/0., pcMax );
-        Valgrind::CheckDefined(solidSurface_);
-#endif
-        interfacialArea_[nPhaseIdx][sPhaseIdx] = ans ; //10. ; //
-        interfacialArea_[sPhaseIdx][nPhaseIdx] = interfacialArea_[nPhaseIdx][sPhaseIdx];
-        interfacialArea_[nPhaseIdx][nPhaseIdx] = 0. ;
+        using AnsSurface = typename Problem::SpatialParams::AnsSurface;
+        solidSurface_ = AnsSurface::interfacialArea(aNonWettingSolidSurfaceParams, materialParams, /*Sw=*/0., pcMax);
 
-#if USE_PCMAX
-        const Scalar aws = solidSurface_ - ans ;
-        interfacialArea_[wPhaseIdx][sPhaseIdx] = aws ; //10. ; //
-        interfacialArea_[sPhaseIdx][wPhaseIdx] = interfacialArea_[wPhaseIdx][sPhaseIdx];
-        interfacialArea_[sPhaseIdx][sPhaseIdx] = 0. ;
+        const Scalar aws = solidSurface_ - ans;
+        interfacialArea_[phase0Idx][sPhaseIdx] = aws;
+        interfacialArea_[sPhaseIdx][phase0Idx] = interfacialArea_[phase0Idx][sPhaseIdx];
+        interfacialArea_[sPhaseIdx][sPhaseIdx] = 0.;
 #else
-        const AwsSurfaceParams & aWettingSolidSurfaceParams
-               = problem.spatialParams().aWettingSolidSurfaceParams();
-        Valgrind::CheckDefined(aWettingSolidSurfaceParams);
-        const Scalar aws = AwsSurface::interfacialArea(aWettingSolidSurfaceParams,materialParams, Sw, pc ); // 10.; //
-        interfacialArea_[wPhaseIdx][sPhaseIdx] = aws ;
-        interfacialArea_[sPhaseIdx][wPhaseIdx] = interfacialArea_[wPhaseIdx][sPhaseIdx];
-        interfacialArea_[sPhaseIdx][sPhaseIdx] = 0. ;
+        using AwsSurface = typename Problem::SpatialParams::AwsSurface;
+        const auto& aWettingSolidSurfaceParams = problem.spatialParams().aWettingSolidSurfaceParams();
+        const auto aws = AwsSurface::interfacialArea(aWettingSolidSurfaceParams,materialParams, Sw, pc );
+        interfacialArea_[phase0Idx][sPhaseIdx] = aws ;
+        interfacialArea_[sPhaseIdx][phase0Idx] = interfacialArea_[phase0Idx][sPhaseIdx];
+        interfacialArea_[sPhaseIdx][sPhaseIdx] = 0.;
 #endif
 
-        Valgrind::CheckDefined(interfacialArea_);
-
-        factorMassTransfer_   = problem.spatialParams().factorMassTransfer(element, scv, elemSol);
+        interfacialArea_[phase1Idx][sPhaseIdx] = ans;
+        interfacialArea_[sPhaseIdx][phase1Idx] = interfacialArea_[phase1Idx][sPhaseIdx];
+        interfacialArea_[phase1Idx][phase1Idx] = 0.;
 
-        factorEnergyTransfer_   = problem.spatialParams().factorEnergyTransfer(element, scv, elemSol);
-
-        characteristicLength_   = problem.spatialParams().characteristicLength(element, scv, elemSol);
-
-
-        const unsigned int vIdxGlobal = scv.dofIndex();
-        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
-            const Scalar darcyMagVelocity     = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, vIdxGlobal);
-            const Scalar dynamicViscosity     = fluidState.viscosity(phaseIdx);
-            const Scalar density              = fluidState.density(phaseIdx);
-            const Scalar kinematicViscosity   = dynamicViscosity / density;
-            const Scalar heatCapacity         = FluidSystem::heatCapacity(fluidState, paramCache, phaseIdx);
-            const Scalar thermalConductivity  = FluidSystem::thermalConductivity(fluidState, paramCache, phaseIdx);
+        factorMassTransfer_ = problem.spatialParams().factorMassTransfer(element, scv, elemSol);
+        factorEnergyTransfer_ = problem.spatialParams().factorEnergyTransfer(element, scv, elemSol);
+        characteristicLength_ = problem.spatialParams().characteristicLength(element, scv, elemSol);
 
+        const auto vIdxGlobal = scv.dofIndex();
+        for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+        {
+            const auto darcyMagVelocity    = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, vIdxGlobal);
+            const auto dynamicViscosity    = fluidState.viscosity(phaseIdx);
+            const auto density             = fluidState.density(phaseIdx);
+            const auto kinematicViscosity  = dynamicViscosity/density;
+            const auto heatCapacity        = FluidSystem::heatCapacity(fluidState, paramCache, phaseIdx);
+            const auto thermalConductivity = FluidSystem::thermalConductivity(fluidState, paramCache, phaseIdx);
 
             // diffusion coefficient of non-wetting component in wetting phase
-            const Scalar diffCoeff =  FluidSystem::binaryDiffusionCoefficient(fluidState, paramCache, phaseIdx, wCompIdx, nCompIdx);
-            const Scalar porosity = problem.spatialParams().porosity(element,
-                                                                    scv,
-                                                                   elemSol);
-
-            reynoldsNumber_[phaseIdx]   = DimLessNum::reynoldsNumber(darcyMagVelocity,
-                                                                     characteristicLength_,
-                                                                     kinematicViscosity);
-
-            prandtlNumber_[phaseIdx]    = DimLessNum::prandtlNumber(dynamicViscosity,
-                                                                    heatCapacity,
-                                                                    thermalConductivity);
-
-            nusseltNumber_[phaseIdx]    = DimLessNum::nusseltNumberForced(reynoldsNumber_[phaseIdx],
-                                                                          prandtlNumber_[phaseIdx],
-                                                                          porosity,
-                                                                          nusseltFormulation);
-
-            schmidtNumber_[phaseIdx]    = DimLessNum::schmidtNumber(dynamicViscosity,
-                                                                    density,
-                                                                    diffCoeff);
-
+            const auto porosity = problem.spatialParams().porosity(element, scv, elemSol);
+            const auto diffCoeff = FluidSystem::binaryDiffusionCoefficient(fluidState,
+                                                                           paramCache,
+                                                                           phaseIdx,
+                                                                           wCompIdx,
+                                                                           nCompIdx);
+
+            reynoldsNumber_[phaseIdx] = DimLessNum::reynoldsNumber(darcyMagVelocity, characteristicLength_, kinematicViscosity);
+            prandtlNumber_[phaseIdx]  = DimLessNum::prandtlNumber(dynamicViscosity, heatCapacity, thermalConductivity);
+            schmidtNumber_[phaseIdx]  = DimLessNum::schmidtNumber(dynamicViscosity, density, diffCoeff);
+            nusseltNumber_[phaseIdx]  = DimLessNum::nusseltNumberForced(reynoldsNumber_[phaseIdx],
+                                                                        prandtlNumber_[phaseIdx],
+                                                                        porosity,
+                                                                        ModelTraits::nusseltFormulation());
             // If Diffusion is not enabled, Sherwood is divided by zero
-            sherwoodNumber_[phaseIdx]   = DimLessNum::sherwoodNumber(reynoldsNumber_[phaseIdx],
-                                                                      schmidtNumber_[phaseIdx],
-                                                                      sherwoodFormulation);
+            sherwoodNumber_[phaseIdx] = DimLessNum::sherwoodNumber(reynoldsNumber_[phaseIdx],
+                                                                   schmidtNumber_[phaseIdx],
+                                                                   ModelTraits::sherwoodFormulation());
         }
     }
 
-    void updateMoleFraction(FluidState & actualFluidState,
-                            ParameterCache & paramCache,
-                            const PrimaryVariables & priVars)
+    /*!
+     * \brief Update composition of all phases in the mutable parameters from the primary variables.
+     *
+     *  \param actualFluidState Container for all the secondary variables concerning the fluids
+     *  \param paramCache Container for cache parameters
+     *  \param priVars The primary Variables
+     */
+    void updateMoleFraction(FluidState& actualFluidState,
+                            ParameterCache& paramCache,
+                            const typename Traits::PrimaryVariables& priVars)
     {
         // setting the mole fractions of the fluid state
-        for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx){
-                // set the component mole fractions
-                for (int compIdx = 0; compIdx < numComponents; ++compIdx) {
-                    actualFluidState.setMoleFraction(phaseIdx,
-                           compIdx,
-                           priVars[moleFrac00Idx +
-                                   phaseIdx*numComponents +
-                                   compIdx]);
-                }
-            }
-
-//            // For using the ... other way of calculating equilibrium
-//             THIS IS ONLY FOR silencing Valgrind but is not used in this model
-            for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx)
-                for (int compIdx = 0; compIdx < numComponents; ++compIdx) {
-                    const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
-                                                                        paramCache,
-                                                                        phaseIdx,
-                                                                        compIdx);
-                    actualFluidState.setFugacityCoefficient(phaseIdx,
-                                                      compIdx,
-                                                      phi);
-            }
-
-            FluidState equilFluidState; // the fluidState *on the interface* i.e. chemical equilibrium
-            equilFluidState.assign(actualFluidState) ;
-            ConstraintSolver::solve(equilFluidState,
-                                    paramCache,
-                                    /*setViscosity=*/false,
-                                    /*setEnthalpy=*/false) ;
-
-            // Setting the equilibrium composition (in a kinetic model not necessarily the same as the actual mole fraction)
-            for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx){
-                for (int compIdx=0; compIdx< numComponents; ++ compIdx){
-                    xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
-                }
-            }
-
-            // compute densities of all phases
-            for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx){
-                const Scalar rho = FluidSystem::density(actualFluidState, paramCache, phaseIdx);
-                actualFluidState.setDensity(phaseIdx, rho);
-            }
-
+        for(int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            for (int compIdx = 0; compIdx < numComponents; ++compIdx)
+                actualFluidState.setMoleFraction( phaseIdx,
+                                                  compIdx,
+                                                  priVars[Indices::conti0EqIdx+phaseIdx*numComponents+compIdx] );
+
+        // For using the ... other way of calculating equilibrium
+        for(int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            for (int compIdx = 0; compIdx < numComponents; ++compIdx)
+                actualFluidState.setFugacityCoefficient( phaseIdx,
+                                                         compIdx,
+                                                         FluidSystem::fugacityCoefficient(actualFluidState,
+                                                                                          paramCache,
+                                                                                          phaseIdx,
+                                                                                          compIdx) );
+
+        FluidState equilFluidState; // the fluidState *on the interface* i.e. chemical equilibrium
+        equilFluidState.assign(actualFluidState);
+        ConstraintSolver::solve(equilFluidState, paramCache, /*setViscosity=*/false, /*setEnthalpy=*/false);
+
+        // Set the equilibrium composition (in a kinetic model not necessarily the same as the actual mole fraction)
+        for(int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
+            for (int compIdx = 0; compIdx < numComponents; ++compIdx)
+                xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
+
+        // compute densities of all phases
+        for(int phaseIdx=0; phaseIdx<numPhases; ++phaseIdx)
+            actualFluidState.setDensity(phaseIdx, FluidSystem::density(actualFluidState, paramCache, phaseIdx));
      }
 
-    template<class ElementSolution>
-    void updateTemperatures(const ElementSolution& elemSol,
-                            const Problem &problem,
+    /*!
+     * \brief Update the temperatures for a given control volume
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param problem The problem to be solved
+     * \param element An element which contains part of the control volume
+     * \param scv The sub-control volume
+     * \param fluidState Container for all the secondary variables concerning the fluids
+     */
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateTemperatures(const ElemSol& elemSol,
+                            const Problem& problem,
                             const Element& element,
-                            const SubControlVolume& scv,
+                            const Scv& scv,
                             FluidState& fluidState)
     {
         for(int phaseIdx=0; phaseIdx < numEnergyEqFluid; ++phaseIdx)
         {
             // retrieve temperature from solution vector
-            const Scalar T = BaseType::extractDofPriVars(elemSol, scv)[temperature0Idx + phaseIdx];
+            const Scalar T = elemSol[scv.indexInElement()][Indices::temperature0Idx + phaseIdx];
             fluidState.setTemperature(phaseIdx, T);
         }
+
         for(int solidPhaseIdx = numEnergyEqFluid; solidPhaseIdx < numEnergyEqFluid+numEnergyEqSolid; ++solidPhaseIdx)
-        {
-            temperatureSolid_ = BaseType::extractDofPriVars(elemSol, scv)[temperature0Idx + solidPhaseIdx];
-        }
+            temperatureSolid_ = elemSol[scv.indexInElement()][Indices::temperature0Idx + solidPhaseIdx];
     }
 
     /*!
-     * \brief Returns the temperature in fluid / solid phase(s)
-     *        the sub-control volume.
-     * \param phaseIdx The local index of the phases
-     */
-    const Scalar temperatureSolid() const
-    { return temperatureSolid_; }
-    /*!
-     * \brief The mole fraction we would have in the case of chemical equilibrium /
+     * \brief The mole fraction we would have in the case of chemical equilibrium
      *        on the interface.
      *
-     *     \param phaseIdx The index of the fluid phase
-     *     \param compIdx The local index of the component
+     * \param phaseIdx The index of the fluid phase
+     * \param compIdx The local index of the component
      */
     const Scalar xEquil(const unsigned int phaseIdx, const unsigned int compIdx) const
-    {
-        return xEquil_[phaseIdx][compIdx] ;
-    }
+    { return xEquil_[phaseIdx][compIdx]; }
 
     /*!
      * \brief The specific interfacial area between two fluid phases [m^2 / m^3]
-     *
-     * This is _only_ required by the kinetic mass/energy modules
-     *
+     * \note This is _only_ required by the kinetic mass/energy modules
      */
     const Scalar interfacialArea(const unsigned int phaseIIdx, const unsigned int phaseJIdx) const
     {
@@ -774,56 +635,24 @@ public:
         return interfacialArea_[phaseIIdx][phaseJIdx];
     }
 
+    //! Returns the temperature of the solid phase(s)
+    const Scalar temperatureSolid() const { return temperatureSolid_; }
     //! access function Reynolds Number
-    const Scalar reynoldsNumber(const unsigned int phaseIdx) const
-    { return reynoldsNumber_[phaseIdx]; }
-
+    const Scalar reynoldsNumber(const unsigned int phaseIdx) const { return reynoldsNumber_[phaseIdx]; }
     //! access function Prandtl Number
-    const Scalar prandtlNumber(const unsigned int phaseIdx) const
-    { return prandtlNumber_[phaseIdx]; }
-
+    const Scalar prandtlNumber(const unsigned int phaseIdx) const { return prandtlNumber_[phaseIdx]; }
     //! access function Nusselt Number
-    const Scalar nusseltNumber(const unsigned int phaseIdx) const
-    { return nusseltNumber_[phaseIdx]; }
-
+    const Scalar nusseltNumber(const unsigned int phaseIdx) const { return nusseltNumber_[phaseIdx]; }
     //! access function Schmidt Number
-    const Scalar schmidtNumber(const unsigned int phaseIdx) const
-    { return schmidtNumber_[phaseIdx]; }
-
+    const Scalar schmidtNumber(const unsigned int phaseIdx) const { return schmidtNumber_[phaseIdx]; }
     //! access function Sherwood Number
-    const Scalar sherwoodNumber(const unsigned int phaseIdx) const
-    { return sherwoodNumber_[phaseIdx]; }
-
+    const Scalar sherwoodNumber(const unsigned int phaseIdx) const { return sherwoodNumber_[phaseIdx]; }
     //! access function characteristic length
-    const Scalar characteristicLength() const
-    { return characteristicLength_; }
-
+    const Scalar characteristicLength() const { return characteristicLength_; }
     //! access function pre factor energy transfer
-    const Scalar factorEnergyTransfer() const
-    { return factorEnergyTransfer_; }
-
+    const Scalar factorEnergyTransfer() const { return factorEnergyTransfer_; }
     //! access function pre factor mass transfer
-    const Scalar factorMassTransfer() const
-    { return factorMassTransfer_; }
-
-    /*!
-     * \brief If running in valgrind this makes sure that all
-     *        quantities in the volume variables are defined.
-     */
-    void checkDefined() const
-    {
-#if !defined NDEBUG && HAVE_VALGRIND
-        Valgrind::CheckDefined(reynoldsNumber_);
-        Valgrind::CheckDefined(prandtlNumber_);
-        Valgrind::CheckDefined(nusseltNumber_);
-        Valgrind::CheckDefined(schmidtNumber_);
-        Valgrind::CheckDefined(sherwoodNumber_);
-        Valgrind::CheckDefined(characteristicLength_);
-        Valgrind::CheckDefined(factorEnergyTransfer_);
-        Valgrind::CheckDefined(factorMassTransfer_);
-        Valgrind::CheckDefined(interfacialArea_);
-#endif
-    }
+    const Scalar factorMassTransfer() const { return factorMassTransfer_; }
 
 private:
     //! dimensionless numbers
@@ -839,9 +668,8 @@ private:
     Scalar interfacialArea_[numPhases+1][numPhases+1];
     Scalar xEquil_[numPhases][numComponents];
     Scalar temperatureSolid_;
-
 };
-//
+
 } // namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh b/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh
index 6d5652a9e2d57a57002b022a2f4b7bde076f4ed5..63384a4854d2b35ba9faf5dc58c0cc13e9158648 100644
--- a/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh
@@ -24,29 +24,27 @@
 #ifndef DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH
 #define DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup PorousmediumNonEquilibriumModel
  * \brief Adds vtk output fields specific to non-isothermal models
  */
-template<class EquilibriumVtkOutputFields, class FluidSystem, int numEnergyEqFluid, int numEnergyEqSolid>
+template<class ModelTraits, class EquilibriumVtkOutputFields>
 class NonEquilibriumVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using FluidSystem = typename VtkOutputModule::VolumeVariables::FluidSystem;
+
         EquilibriumVtkOutputFields::init(vtk);
-        for (int i = 0; i < numEnergyEqFluid; ++i)
+        for (int i = 0; i < ModelTraits::numEnergyEqFluid(); ++i)
             vtk.addVolumeVariable( [i](const auto& v){ return v.temperature(i); }, "T_" + FluidSystem::phaseName(i) );
-        for (int i = 0; i < numEnergyEqSolid; ++i)
+        for (int i = 0; i < ModelTraits::numEnergyEqSolid(); ++i)
             vtk.addVolumeVariable( [i](const auto& v){ return v.temperatureSolid(); }, "T_solid" );
-        for (int i = 0; i < FluidSystem::numPhases; ++i){
+        for (int i = 0; i < ModelTraits::numPhases(); ++i){
             vtk.addVolumeVariable( [i](const auto& v){ return v.reynoldsNumber(i); }, "reynoldsNumber_" + FluidSystem::phaseName(i) );
             vtk.addVolumeVariable( [i](const auto& v){ return v.nusseltNumber(i); }, "nusseltNumber_" + FluidSystem::phaseName(i) );
             vtk.addVolumeVariable( [i](const auto& v){ return v.prandtlNumber(i); }, "prandtlNumber_" + FluidSystem::phaseName(i) );
diff --git a/dumux/porousmediumflow/nonisothermal/indices.hh b/dumux/porousmediumflow/nonisothermal/indices.hh
index febb62ffdb89f8182910ff83d0cb34bd2f355aaf..47054c978ddf14321828dae357fd23bfe2f37c85 100644
--- a/dumux/porousmediumflow/nonisothermal/indices.hh
+++ b/dumux/porousmediumflow/nonisothermal/indices.hh
@@ -25,26 +25,20 @@
 #ifndef DUMUX_ENERGY_INDICES_HH
 #define DUMUX_ENERGY_INDICES_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup NIModel
  * \brief Indices for the non-isothermal two-phase two-component model
  *
- * \tparam formulation The formulation, either pwsn or pnsw.
- * \tparam PVOffset The first index in a primary variable vector.
+ * \tparam IsothermalIndices The indices of the isothermal model
+ * \tparam numEq the number of equations of the non-isothermal model
  */
-template <class IsothermalIndices, int numEquation, int PVOffset = 0>
-class EnergyIndices : public IsothermalIndices
+template <class IsothermalIndices, int numEq>
+struct EnergyIndices : public IsothermalIndices
 {
-public:
-    static const int numEq = numEquation;
-    static const int temperatureIdx = PVOffset + numEq -1; //!< The index for temperature in primary variable vectors.
-    static const int energyEqIdx = PVOffset + numEq -1; //!< The index for energy in equation vectors.
-
+    static const int temperatureIdx = numEq - 1; //!< The index for temperature in primary variable vectors.
+    static const int energyEqIdx = numEq - 1;    //!< The index for energy in equation vectors.
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/nonisothermal/localresidual.hh b/dumux/porousmediumflow/nonisothermal/localresidual.hh
index 115d3569aefc9a5446658af81fa85ab25124ed4f..b059d516a421a2a61086682cc4e8b3530246875c 100644
--- a/dumux/porousmediumflow/nonisothermal/localresidual.hh
+++ b/dumux/porousmediumflow/nonisothermal/localresidual.hh
@@ -113,7 +113,7 @@ class EnergyLocalResidualImplementation<TypeTag, true>
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum { energyEqIdx = Indices::energyEqIdx };
 
diff --git a/dumux/porousmediumflow/nonisothermal/model.hh b/dumux/porousmediumflow/nonisothermal/model.hh
index 6217831e5ac1422ee94325bf714ac45f10958651..6887c48a3cca24b9e9f225cc79b6f4eecd3ea1b1 100644
--- a/dumux/porousmediumflow/nonisothermal/model.hh
+++ b/dumux/porousmediumflow/nonisothermal/model.hh
@@ -53,10 +53,12 @@
 #ifndef DUMUX_NONISOTHERMAL_MODEL_HH
 #define DUMUX_NONISOTHERMAL_MODEL_HH
 
-namespace Dumux
-{
+#include <dumux/porousmediumflow/nonisothermal/indices.hh>
+
+namespace Dumux {
+
 /*!
- * \ingroup OnePModel
+ * \ingroup NIModel
  * \brief Specifies a number properties of non-isothermal porous medium
  *        flow models based on the specifics of a given isothermal model.
  * \tparam IsothermalTraits Model traits of the isothermal model
@@ -68,6 +70,8 @@ struct PorousMediumFlowNIModelTraits : public IsothermalTraits
     static constexpr int numEq() { return IsothermalTraits::numEq()+1; }
     //! We additionally solve for the equation balance
     static constexpr bool enableEnergyBalance() { return true; }
+    //! The indices related to the non-isothermal model
+    using Indices = EnergyIndices< typename IsothermalTraits::Indices, numEq()>;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh b/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh
index 6c2759bc67a47408c5efa8c496d935c0d0458a79..3c94a1a7cb6c5521adf89f618c25db4fd3de8d26 100644
--- a/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh
@@ -24,10 +24,7 @@
 #ifndef DUMUX_ENERGY_OUTPUT_FIELDS_HH
 #define DUMUX_ENERGY_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup NIModel
diff --git a/dumux/porousmediumflow/problem.hh b/dumux/porousmediumflow/problem.hh
index 1c8ddee977d643218462ee89a4c8898ecee1ac23..eef5675a52d33921784861938df3a7b698ca6a21 100644
--- a/dumux/porousmediumflow/problem.hh
+++ b/dumux/porousmediumflow/problem.hh
@@ -38,7 +38,6 @@ class PorousMediumFlowProblem : public FVProblem<TypeTag>
 {
     using ParentType = FVProblem<TypeTag>;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 
     enum {
@@ -50,6 +49,9 @@ class PorousMediumFlowProblem : public FVProblem<TypeTag>
     using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 public:
+    //! export spatial parameter type
+    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
+
     /*!
      * \brief The constructor
      *
diff --git a/dumux/porousmediumflow/richards/indices.hh b/dumux/porousmediumflow/richards/indices.hh
index 0bd2cb78ed2412c32f9d2dd0703b566a65e13dc6..fbe3eed8d81ef668dc0e027b184fd16e5cdf9658 100644
--- a/dumux/porousmediumflow/richards/indices.hh
+++ b/dumux/porousmediumflow/richards/indices.hh
@@ -24,9 +24,7 @@
 #ifndef DUMUX_RICHARDS_INDICES_HH
 #define DUMUX_RICHARDS_INDICES_HH
 
-namespace Dumux
-{
-// \{
+namespace Dumux {
 
 /*!
  * \ingroup RichardsModel
@@ -35,32 +33,18 @@ namespace Dumux
 
 struct RichardsIndices
 {
-    //////////
-    // primary variable indices
-    //////////
-
     //! Primary variable index for the wetting phase pressure
     static constexpr int pressureIdx = 0;
     static constexpr int switchIdx = 0;
 
-    //////////
-    // equation indices
-    //////////
     //! Equation index for the mass conservation of the wetting phase
     static constexpr int conti0EqIdx = 0;
 
-    //////////
-    // phase indices
-    //////////
-    static constexpr int wPhaseIdx = 0; //!< Index of the wetting phase;
-    static constexpr int nPhaseIdx = 1; //!< Index of the non-wetting phase;
-
     // present phases (-> 'pseudo' primary variable)
-    static constexpr int wPhaseOnly = 1; //!< Only the non-wetting phase is present
-    static constexpr int nPhaseOnly = 2; //!< Only the wetting phase is present
+    static constexpr int liquidPhaseOnly = 1; //!< Only the liquid phase is present
+    static constexpr int gasPhaseOnly = 2; //!< Only the gas phase is present
     static constexpr int bothPhases = 3; //!< Both phases are present
 };
-// \}
 
 } // end namespace Dumux
 
diff --git a/dumux/porousmediumflow/richards/localresidual.hh b/dumux/porousmediumflow/richards/localresidual.hh
index 117b14a91a95095a44486d00791b8fdafd446e59..3927d4716d7a366525eeb86dd6152eb314e8db5b 100644
--- a/dumux/porousmediumflow/richards/localresidual.hh
+++ b/dumux/porousmediumflow/richards/localresidual.hh
@@ -54,15 +54,15 @@ class RichardsLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
     using Element = typename GridView::template Codim<0>::Entity;
     using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     // first index for the mass balance
     enum { conti0EqIdx = Indices::conti0EqIdx };
 
     // phase indices
     enum {
-           wPhaseIdx = FluidSystem::wPhaseIdx,
-           nPhaseIdx = FluidSystem::nPhaseIdx,
-           wCompIdx = FluidSystem::wCompIdx
+           liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
+           gasPhaseIdx = FluidSystem::gasPhaseIdx,
+           liquidCompIdx = FluidSystem::liquidCompIdx
     };
 
     static constexpr bool enableWaterDiffusionInAir
@@ -88,20 +88,20 @@ public:
         // partial time derivative of the phase mass
         NumEqVector storage(0.0);
         storage[conti0EqIdx] = volVars.porosity()
-                               * volVars.density(wPhaseIdx)
-                               * volVars.saturation(wPhaseIdx);
+                               * volVars.density(liquidPhaseIdx)
+                               * volVars.saturation(liquidPhaseIdx);
 
         // for extended Richards we consider water in air
         if (enableWaterDiffusionInAir)
             storage[conti0EqIdx] += volVars.porosity()
-                                    * volVars.molarDensity(nPhaseIdx)
-                                    * volVars.moleFraction(nPhaseIdx, wCompIdx)
-                                    * FluidSystem::molarMass(wCompIdx)
-                                    * volVars.saturation(nPhaseIdx);
+                                    * volVars.molarDensity(gasPhaseIdx)
+                                    * volVars.moleFraction(gasPhaseIdx, liquidCompIdx)
+                                    * FluidSystem::molarMass(liquidCompIdx)
+                                    * volVars.saturation(gasPhaseIdx);
 
         //! The energy storage in the water, air and solid phase
-        EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, wPhaseIdx);
-        EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, nPhaseIdx);
+        EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, liquidPhaseIdx);
+        EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, gasPhaseIdx);
         EnergyLocalResidual::solidPhaseStorage(storage, scv, volVars);
 
         return storage;
@@ -131,16 +131,16 @@ public:
         NumEqVector flux(0.0);
         // the physical quantities for which we perform upwinding
         auto upwindTerm = [](const auto& volVars)
-                          { return volVars.density(wPhaseIdx)*volVars.mobility(wPhaseIdx); };
+                          { return volVars.density(liquidPhaseIdx)*volVars.mobility(liquidPhaseIdx); };
 
-        flux[conti0EqIdx] = fluxVars.advectiveFlux(wPhaseIdx, upwindTerm);
+        flux[conti0EqIdx] = fluxVars.advectiveFlux(liquidPhaseIdx, upwindTerm);
 
         // for extended Richards we consider water vapor diffusion in air
         if (enableWaterDiffusionInAir)
-            flux[conti0EqIdx] += fluxVars.molecularDiffusionFlux(nPhaseIdx)[wCompIdx]*FluidSystem::molarMass(wCompIdx);
+            flux[conti0EqIdx] += fluxVars.molecularDiffusionFlux(gasPhaseIdx)[liquidCompIdx]*FluidSystem::molarMass(liquidCompIdx);
 
         //! Add advective phase energy fluxes for the water phase only. For isothermal model the contribution is zero.
-        EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, wPhaseIdx);
+        EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, liquidPhaseIdx);
 
         //! Add diffusive energy fluxes. For isothermal model the contribution is zero.
         //! The effective lambda is averaged over both fluid phases and the solid phase
diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh
index 938b421d6a1c29d2c4c9052702d088bff4bda3d3..d8bed2a2264be6f9d20cab21da7859b2bc60b9a2 100644
--- a/dumux/porousmediumflow/richards/model.hh
+++ b/dumux/porousmediumflow/richards/model.hh
@@ -115,17 +115,20 @@
 #include "localresidual.hh"
 #include "primaryvariableswitch.hh"
 
-namespace Dumux
-{
+namespace Dumux {
+
 /*!
  * \ingroup RichardsModel
  * \brief Specifies a number properties of the Richards model.
  *
  * \tparam enableDiff specifies if diffusion of water in air is to be considered.
+ * \tparam useKelvin whether kelvin equation is used for the vapor pressure
  */
-template<bool enableDiff>
+template<bool enableDiff, bool useKelvin>
 struct RichardsModelTraits
 {
+    using Indices = RichardsIndices;
+
     static constexpr int numEq() { return 1; }
     static constexpr int numPhases() { return 2; }
     static constexpr int numComponents() { return 1; }
@@ -133,6 +136,28 @@ struct RichardsModelTraits
     static constexpr bool enableAdvection() { return true; }
     static constexpr bool enableMolecularDiffusion() { return enableDiff; }
     static constexpr bool enableEnergyBalance() { return false; }
+
+    static constexpr bool useKelvinVaporPressure() { return useKelvin; }
+};
+
+/*!
+ * \ingroup RichardsModel
+ * \brief Traits class for the Richards model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam FST The fluid state type
+ * \tparam PT The type used for permeabilities
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class FST, class PT, class MT>
+struct RichardsVolumeVariablesTraits
+{
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using FluidState = FST;
+    using PermeabilityType = PT;
+    using ModelTraits = MT;
 };
 
 // \{
@@ -160,19 +185,31 @@ SET_TYPE_PROP(Richards, LocalResidual, RichardsLocalResidual<TypeTag>);
 SET_PROP(Richards, VtkOutputFields)
 {
 private:
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
    static constexpr bool enableWaterDiffusionInAir
         = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir);
 
 public:
-    using type = RichardsVtkOutputFields<Indices, enableWaterDiffusionInAir>;
+    using type = RichardsVtkOutputFields<enableWaterDiffusionInAir>;
 };
 
 //! The model traits
-SET_TYPE_PROP(Richards, ModelTraits, RichardsModelTraits<GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir)>);
+SET_TYPE_PROP(Richards, ModelTraits, RichardsModelTraits<GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir),
+                                                         GET_PROP_VALUE(TypeTag, UseKelvinEquation)>);
 
-//! The class for the volume averaged quantities
-SET_TYPE_PROP(Richards, VolumeVariables, RichardsVolumeVariables<TypeTag>);
+//! Set the volume variables property
+SET_PROP(Richards, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = RichardsVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = RichardsVolumeVariables<Traits>;
+};
 
 //! The default richards model computes no diffusion in the air phase
 //! Turning this on leads to the extended Richards equation (see e.g. Vanderborght et al. 2017)
@@ -185,9 +222,6 @@ SET_TYPE_PROP(Richards, EffectiveDiffusivityModel,
 //! The default is not to use the kelvin equation for the water vapor pressure (dependency on pc)
 SET_BOOL_PROP(Richards, UseKelvinEquation, false);
 
-//! The class with all index definitions for the model
-SET_TYPE_PROP(Richards, Indices, RichardsIndices);
-
 //! The primary variables vector for the richards model
 SET_PROP(Richards, PrimaryVariables)
 {
@@ -199,7 +233,7 @@ public:
 };
 
 //! The primary variable switch for the richards model
-SET_TYPE_PROP(Richards, PrimaryVariableSwitch, ExtendedRichardsPrimaryVariableSwitch<TypeTag>);
+SET_TYPE_PROP(Richards, PrimaryVariableSwitch, ExtendedRichardsPrimaryVariableSwitch);
 
 //! The primary variable switch for the richards model
 // SET_BOOL_PROP(Richards, ProblemUsePrimaryVariableSwitch, false);
@@ -239,9 +273,8 @@ SET_PROP(RichardsNI, ThermalConductivityModel)
 {
 private:
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 public:
-    using type = ThermalConductivitySomerton<Scalar, Indices>;
+    using type = ThermalConductivitySomerton<Scalar>;
 };
 
 /////////////////////////////////////////////////////
@@ -252,28 +285,18 @@ public:
 SET_PROP(RichardsNI, ModelTraits)
 {
 private:
-    using IsothermalTraits = RichardsModelTraits<GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir)>;
+    using IsothermalTraits = RichardsModelTraits<GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir),
+                                                 GET_PROP_VALUE(TypeTag, UseKelvinEquation)>;
 public:
     using type = PorousMediumFlowNIModelTraits<IsothermalTraits>;
 };
 
-//! set non-isothermal Indices
-SET_PROP(RichardsNI, Indices)
-{
-private:
-    using IsothermalIndices = RichardsIndices;
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
-};
-
 //! Set the vtk output fields specific to th non-isothermal model
 SET_PROP(RichardsNI, VtkOutputFields)
 {
 private:
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
    static constexpr bool enableWaterDiffusionInAir = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir);
-   using IsothermalFields = RichardsVtkOutputFields<Indices, enableWaterDiffusionInAir>;
+   using IsothermalFields = RichardsVtkOutputFields<enableWaterDiffusionInAir>;
 public:
     using type = EnergyVtkOutputFields<IsothermalFields>;
 };
diff --git a/dumux/porousmediumflow/richards/newtonsolver.hh b/dumux/porousmediumflow/richards/newtonsolver.hh
index 0c89333066704885e2da39a4bb01a5b7e436f4b4..0cbcf6faec39f5c5d17abac7eb72f93d1f28845a 100644
--- a/dumux/porousmediumflow/richards/newtonsolver.hh
+++ b/dumux/porousmediumflow/richards/newtonsolver.hh
@@ -47,7 +47,7 @@ class RichardsNewtonSolver : public RichardsPrivarSwitchNewtonSolver<TypeTag, As
     using SolutionVector = typename Assembler::ResidualType;
 
     using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum { pressureIdx = Indices::pressureIdx };
 
 public:
diff --git a/dumux/porousmediumflow/richards/primaryvariableswitch.hh b/dumux/porousmediumflow/richards/primaryvariableswitch.hh
index dc28bac64af1b7897d90d85accfaec521674a730..5c07d13a1a428422533b5722b6d8d4f80d14c4dd 100644
--- a/dumux/porousmediumflow/richards/primaryvariableswitch.hh
+++ b/dumux/porousmediumflow/richards/primaryvariableswitch.hh
@@ -36,81 +36,50 @@ namespace Dumux {
  * \ingroup RichardsModel
  * \brief The primary variable switch controlling the phase presence state variable.
  */
-template<class TypeTag>
 class ExtendedRichardsPrimaryVariableSwitch
-: public PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), ExtendedRichardsPrimaryVariableSwitch<TypeTag>>
+: public PrimaryVariableSwitch<ExtendedRichardsPrimaryVariableSwitch>
 {
-    using ParentType = PrimaryVariableSwitch<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), ExtendedRichardsPrimaryVariableSwitch<TypeTag>>;
+    using ParentType = PrimaryVariableSwitch<ExtendedRichardsPrimaryVariableSwitch>;
     friend ParentType;
 
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using IndexType = typename GridView::IndexSet::IndexType;
-    using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum {
-        switchIdx = Indices::switchIdx,
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-
-        wCompIdx = FluidSystem::wCompIdx,
-
-        wPhaseOnly = Indices::wPhaseOnly,
-        nPhaseOnly = Indices::nPhaseOnly,
-        bothPhases = Indices::bothPhases
-    };
-
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-
-    static constexpr bool enableWaterDiffusionInAir
-        = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir);
-    static constexpr bool useKelvinVaporPressure
-        = GET_PROP_VALUE(TypeTag, UseKelvinEquation);
-
 public:
     using ParentType::ParentType;
 
 protected:
 
     // perform variable switch at a degree of freedom location
-    bool update_(PrimaryVariables& priVars,
+    template<class VolumeVariables, class GlobalPosition>
+    bool update_(typename VolumeVariables::PrimaryVariables& priVars,
                  const VolumeVariables& volVars,
-                 IndexType dofIdxGlobal,
+                 std::size_t dofIdxGlobal,
                  const GlobalPosition& globalPos)
     {
-        static const bool usePriVarSwitch = getParamFromGroup<bool>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Problem.UsePrimaryVariableSwitch");
+        using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
+        using Indices = typename VolumeVariables::Indices;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
+        static const bool usePriVarSwitch = getParam<bool>("Problem.UsePrimaryVariableSwitch");
         if (!usePriVarSwitch)
             return false;
 
-        if (!enableWaterDiffusionInAir)
+        if (!VolumeVariables::enableWaterDiffusionInAir())
             DUNE_THROW(Dune::InvalidStateException, "The Richards primary variable switch only works with water diffusion in air enabled!");
 
+        static constexpr int liquidCompIdx = FluidSystem::liquidPhaseIdx;
+
         // evaluate primary variable switch
         bool wouldSwitch = false;
         int phasePresence = priVars.state();
         int newPhasePresence = phasePresence;
 
         // check if a primary var switch is necessary
-        if (phasePresence == nPhaseOnly)
+        if (phasePresence == Indices::gasPhaseOnly)
         {
             // if the mole fraction of water is larger than the one
             // predicted by a liquid-vapor equilibrium
-            Scalar xnw = volVars.moleFraction(nPhaseIdx, wCompIdx);
+            Scalar xnw = volVars.moleFraction(FluidSystem::gasPhaseIdx, liquidCompIdx);
             Scalar xnwPredicted = FluidSystem::H2O::vaporPressure(volVars.temperature())
-                                  / volVars.pressure(nPhaseIdx);
-            if (useKelvinVaporPressure)
-            {
-                using std::exp;
-                xnwPredicted *= exp(-volVars.capillaryPressure()
-                                     * FluidSystem::H2O::molarMass() / volVars.density(wPhaseIdx)
-                                     / Constants<Scalar>::R / volVars.temperature());
-            }
+                                  / volVars.pressure(FluidSystem::gasPhaseIdx);
 
             Scalar xwMax = 1.0;
             if (xnw / xnwPredicted > xwMax)
@@ -126,31 +95,31 @@ protected:
                 std::cout << "wetting phase appears at vertex " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", xnw / xnwPredicted * 100: "
                           << xnw / xnwPredicted * 100 << "%"
-                          << ", at x_n^w: " << priVars[switchIdx] << std::endl;
-                newPhasePresence = bothPhases;
-                priVars[switchIdx] = 0.0;
+                          << ", at x_n^w: " << priVars[Indices::switchIdx] << std::endl;
+                newPhasePresence = Indices::bothPhases;
+                priVars[Indices::switchIdx] = 0.0;
             }
         }
-        else if (phasePresence == bothPhases)
+        else if (phasePresence == Indices::bothPhases)
         {
             Scalar Smin = 0.0;
             if (this->wasSwitched_[dofIdxGlobal])
                 Smin = -0.01;
 
-            if (volVars.saturation(wPhaseIdx) <= Smin)
+            if (volVars.saturation(FluidSystem::liquidPhaseIdx) <= Smin)
             {
                 wouldSwitch = true;
                 // wetting phase disappears
-                newPhasePresence = nPhaseOnly;
-                priVars[switchIdx] = volVars.moleFraction(nPhaseIdx, wCompIdx);
+                newPhasePresence = Indices::gasPhaseOnly;
+                priVars[Indices::switchIdx] = volVars.moleFraction(FluidSystem::gasPhaseIdx, liquidCompIdx);
 
                 std::cout << "Wetting phase disappears at vertex " << dofIdxGlobal
                           << ", coordinates: " << globalPos << ", sw: "
-                          << volVars.saturation(wPhaseIdx)
-                          << ", x_n^w: " << priVars[switchIdx] << std::endl;
+                          << volVars.saturation(FluidSystem::liquidPhaseIdx)
+                          << ", x_n^w: " << priVars[Indices::switchIdx] << std::endl;
             }
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == Indices::liquidPhaseOnly)
         {
             DUNE_THROW(Dune::NotImplemented, "Water phase only phase presence!");
         }
diff --git a/dumux/porousmediumflow/richards/volumevariables.hh b/dumux/porousmediumflow/richards/volumevariables.hh
index 7ecd32cfa36bd161520d2fb0f01fbddf8003521a..8f2169eefd1cbefb333549f33b04d2ffea986af5 100644
--- a/dumux/porousmediumflow/richards/volumevariables.hh
+++ b/dumux/porousmediumflow/richards/volumevariables.hh
@@ -27,7 +27,7 @@
 #include <cassert>
 
 #include <dune/common/exceptions.hh>
-#include <dumux/common/properties.hh>
+
 #include <dumux/porousmediumflow/volumevariables.hh>
 #include <dumux/material/idealgas.hh>
 #include <dumux/material/constants.hh>
@@ -41,52 +41,24 @@ namespace Dumux {
  * This contains the quantities which are are constant within a finite
  * volume in the Richards model.
  */
-template <class TypeTag>
-class RichardsVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class RichardsVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, RichardsVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum{
-         pressureIdx = Indices::pressureIdx,
-         switchIdx = Indices::switchIdx,
-         wPhaseIdx = Indices::wPhaseIdx,
-         nPhaseIdx = Indices::nPhaseIdx,
-         wCompIdx = FluidSystem::wCompIdx,
-         nCompIdx = FluidSystem::nCompIdx
-    };
-
-    // present phases
-    enum
-    {
-        wPhaseOnly = Indices::wPhaseOnly,
-        nPhaseOnly = Indices::nPhaseOnly,
-        bothPhases = Indices::bothPhases
-    };
-
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
-
-    static constexpr bool enableWaterDiffusionInAir
-        = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir);
-    static constexpr bool useKelvinVaporPressure
-        = GET_PROP_VALUE(TypeTag, UseKelvinEquation);
-
-    static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases();
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, RichardsVolumeVariables<Traits>>;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using ModelTraits = typename Traits::ModelTraits;
 
 public:
-
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+    //! export type of the fluid system
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export type of the fluid state
+    using FluidState = typename Traits::FluidState;
+    //! export type of the fluid state
+    using Indices = typename Traits::ModelTraits::Indices;
+    //! if water diffusion in air is enabled
+    static constexpr bool enableWaterDiffusionInAir() { return ModelTraits::enableMolecularDiffusion(); };
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -97,13 +69,14 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
-        static_assert(!(!enableWaterDiffusionInAir && useKelvinVaporPressure),
+        // TODO check this is the fluid system now
+        static_assert(!(!enableWaterDiffusionInAir() && ModelTraits::useKelvinVaporPressure()),
           "Kevin vapor presssure only makes sense if water in air is considered!");
 
         ParentType::update(elemSol, problem, element, scv);
@@ -113,15 +86,16 @@ public:
 
         // precompute the minimum capillary pressure (entry pressure)
         // needed to make sure we don't compute unphysical capillary pressures and thus saturations
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         minPc_ = MaterialLaw::endPointPc(materialParams);
 
-        if (phasePresence == nPhaseOnly)
+        if (phasePresence == Indices::gasPhaseOnly)
         {
-            moleFraction_[wPhaseIdx] = 1.0;
-            moleFraction_[nPhaseIdx] = priVars[switchIdx];
+            moleFraction_[FluidSystem::liquidPhaseIdx] = 1.0;
+            moleFraction_[FluidSystem::gasPhaseIdx] = priVars[Indices::switchIdx];
 
-            fluidState_.setSaturation(wPhaseIdx, 0.0);
-            fluidState_.setSaturation(nPhaseIdx, 1.0);
+            fluidState_.setSaturation(FluidSystem::liquidPhaseIdx, 0.0);
+            fluidState_.setSaturation(FluidSystem::gasPhaseIdx, 1.0);
 
             Scalar t = ParentType::temperature(elemSol, problem, element, scv);
             fluidState_.setTemperature(t);
@@ -130,59 +104,53 @@ public:
             const Scalar pc = MaterialLaw::pc(materialParams, 0.0);
 
             // set the wetting pressure
-            fluidState_.setPressure(wPhaseIdx, problem.nonWettingReferencePressure() - pc);
-            fluidState_.setPressure(nPhaseIdx, problem.nonWettingReferencePressure());
+            fluidState_.setPressure(FluidSystem::liquidPhaseIdx, problem.nonWettingReferencePressure() - pc);
+            fluidState_.setPressure(FluidSystem::gasPhaseIdx, problem.nonWettingReferencePressure());
 
             // set molar densities
-            molarDensity_[wPhaseIdx] = FluidSystem::H2O::liquidDensity(temperature(), pressure(wPhaseIdx))/FluidSystem::H2O::molarMass();
-            molarDensity_[nPhaseIdx] = IdealGas<Scalar>::molarDensity(temperature(), problem.nonWettingReferencePressure());
+            molarDensity_[FluidSystem::liquidPhaseIdx] = FluidSystem::H2O::liquidDensity(temperature(), pressure(FluidSystem::liquidPhaseIdx))/FluidSystem::H2O::molarMass();
+            molarDensity_[FluidSystem::gasPhaseIdx] = IdealGas<Scalar>::molarDensity(temperature(), problem.nonWettingReferencePressure());
 
             // density and viscosity
             typename FluidSystem::ParameterCache paramCache;
             paramCache.updateAll(fluidState_);
-            fluidState_.setDensity(wPhaseIdx, FluidSystem::density(fluidState_, paramCache, wPhaseIdx));
-            fluidState_.setDensity(nPhaseIdx, FluidSystem::density(fluidState_, paramCache, nPhaseIdx));
-            fluidState_.setViscosity(wPhaseIdx, FluidSystem::viscosity(fluidState_, paramCache, wPhaseIdx));
+            fluidState_.setDensity(FluidSystem::liquidPhaseIdx, FluidSystem::density(fluidState_, paramCache, FluidSystem::liquidPhaseIdx));
+            fluidState_.setDensity(FluidSystem::gasPhaseIdx, FluidSystem::density(fluidState_, paramCache, FluidSystem::gasPhaseIdx));
+            fluidState_.setViscosity(FluidSystem::liquidPhaseIdx, FluidSystem::viscosity(fluidState_, paramCache, FluidSystem::liquidPhaseIdx));
 
             // compute and set the enthalpy
-            fluidState_.setEnthalpy(wPhaseIdx, Implementation::enthalpy(fluidState_, paramCache, wPhaseIdx));
-            fluidState_.setEnthalpy(nPhaseIdx, Implementation::enthalpy(fluidState_, paramCache, nPhaseIdx));
+            fluidState_.setEnthalpy(FluidSystem::liquidPhaseIdx, ParentType::enthalpy(fluidState_, paramCache, FluidSystem::liquidPhaseIdx));
+            fluidState_.setEnthalpy(FluidSystem::gasPhaseIdx, ParentType::enthalpy(fluidState_, paramCache, FluidSystem::gasPhaseIdx));
         }
-        else if (phasePresence == bothPhases)
+        else if (phasePresence == Indices::bothPhases)
         {
-            Implementation::completeFluidState(elemSol, problem, element, scv, fluidState_);
+            completeFluidState(elemSol, problem, element, scv, fluidState_);
 
             // if we want to account for diffusion in the air phase
             // use Raoult to compute the water mole fraction in air
-            if (enableWaterDiffusionInAir)
+            if (enableWaterDiffusionInAir())
             {
-                molarDensity_[wPhaseIdx] = FluidSystem::H2O::liquidDensity(temperature(), pressure(wPhaseIdx))/FluidSystem::H2O::molarMass();
-                molarDensity_[nPhaseIdx] = IdealGas<Scalar>::molarDensity(temperature(), problem.nonWettingReferencePressure());
-                moleFraction_[wPhaseIdx] = 1.0;
-
-                moleFraction_[nPhaseIdx] = FluidSystem::H2O::vaporPressure(temperature()) / problem.nonWettingReferencePressure();
-                if (useKelvinVaporPressure)
-                {
-                    using std::exp;
-                    moleFraction_[nPhaseIdx] *= exp(-capillaryPressure() * FluidSystem::H2O::molarMass()/density(wPhaseIdx)
-                                                     / Constants<Scalar>::R / temperature());
-                }
+                molarDensity_[FluidSystem::liquidPhaseIdx] = FluidSystem::H2O::liquidDensity(temperature(), pressure(FluidSystem::liquidPhaseIdx))/FluidSystem::H2O::molarMass();
+                molarDensity_[FluidSystem::gasPhaseIdx] = IdealGas<Scalar>::molarDensity(temperature(), problem.nonWettingReferencePressure());
+                moleFraction_[FluidSystem::liquidPhaseIdx] = 1.0;
+
+                moleFraction_[FluidSystem::gasPhaseIdx] = FluidSystem::H2O::vaporPressure(temperature()) / problem.nonWettingReferencePressure();
 
                 // binary diffusion coefficients
                 typename FluidSystem::ParameterCache paramCache;
                 paramCache.updateAll(fluidState_);
-                diffCoeff_ = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, nPhaseIdx, wCompIdx, nCompIdx);
+                diffCoeff_ = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, FluidSystem::gasPhaseIdx, FluidSystem::comp0Idx, FluidSystem::comp1Idx);
             }
         }
-        else if (phasePresence == wPhaseOnly)
+        else if (phasePresence == Indices::liquidPhaseOnly)
         {
-            Implementation::completeFluidState(elemSol, problem, element, scv, fluidState_);
+            completeFluidState(elemSol, problem, element, scv, fluidState_);
         }
 
         //////////
         // specify the other parameters
         //////////
-        relativePermeabilityWetting_ = MaterialLaw::krw(materialParams, fluidState_.saturation(wPhaseIdx));
+        relativePermeabilityWetting_ = MaterialLaw::krw(materialParams, fluidState_.saturation(FluidSystem::liquidPhaseIdx));
         porosity_ = problem.spatialParams().porosity(element, scv, elemSol);
         permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
     }
@@ -200,11 +168,11 @@ public:
      * \param scv The subcontrol volume.
      * \param fluidState The fluid state to fill.
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static void completeFluidState(const ElemSol& elemSol,
                                    const Problem& problem,
                                    const Element& element,
-                                   const SubControlVolume& scv,
+                                   const Scv& scv,
                                    FluidState& fluidState)
     {
         Scalar t = ParentType::temperature(elemSol, problem, element, scv);
@@ -215,30 +183,31 @@ public:
 
         // set the wetting pressure
         using std::max;
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         Scalar minPc = MaterialLaw::pc(materialParams, 1.0);
-        fluidState.setPressure(wPhaseIdx, priVars[pressureIdx]);
-        fluidState.setPressure(nPhaseIdx, max(problem.nonWettingReferencePressure(), fluidState.pressure(wPhaseIdx) + minPc));
+        fluidState.setPressure(FluidSystem::liquidPhaseIdx, priVars[Indices::pressureIdx]);
+        fluidState.setPressure(FluidSystem::gasPhaseIdx, max(problem.nonWettingReferencePressure(), fluidState.pressure(FluidSystem::liquidPhaseIdx) + minPc));
 
         // compute the capillary pressure to compute the saturation
         // make sure that we the capillary pressure is not smaller than the minimum pc
         // this would possibly return unphysical values from regularized material laws
         using std::max;
         const Scalar pc = max(MaterialLaw::endPointPc(materialParams),
-                              problem.nonWettingReferencePressure() - fluidState.pressure(wPhaseIdx));
+                              problem.nonWettingReferencePressure() - fluidState.pressure(FluidSystem::liquidPhaseIdx));
         const Scalar sw = MaterialLaw::sw(materialParams, pc);
-        fluidState.setSaturation(wPhaseIdx, sw);
-        fluidState.setSaturation(nPhaseIdx, 1.0-sw);
+        fluidState.setSaturation(FluidSystem::liquidPhaseIdx, sw);
+        fluidState.setSaturation(FluidSystem::gasPhaseIdx, 1.0-sw);
 
         // density and viscosity
         typename FluidSystem::ParameterCache paramCache;
         paramCache.updateAll(fluidState);
-        fluidState.setDensity(wPhaseIdx, FluidSystem::density(fluidState, paramCache, wPhaseIdx));
-        fluidState.setDensity(nPhaseIdx, FluidSystem::density(fluidState, paramCache, nPhaseIdx));
-        fluidState.setViscosity(wPhaseIdx, FluidSystem::viscosity(fluidState, paramCache, wPhaseIdx));
+        fluidState.setDensity(FluidSystem::liquidPhaseIdx, FluidSystem::density(fluidState, paramCache, FluidSystem::liquidPhaseIdx));
+        fluidState.setDensity(FluidSystem::gasPhaseIdx, FluidSystem::density(fluidState, paramCache, FluidSystem::gasPhaseIdx));
+        fluidState.setViscosity(FluidSystem::liquidPhaseIdx, FluidSystem::viscosity(fluidState, paramCache, FluidSystem::liquidPhaseIdx));
 
         // compute and set the enthalpy
-        fluidState.setEnthalpy(wPhaseIdx, Implementation::enthalpy(fluidState, paramCache, wPhaseIdx));
-        fluidState.setEnthalpy(nPhaseIdx, Implementation::enthalpy(fluidState, paramCache, nPhaseIdx));
+        fluidState.setEnthalpy(FluidSystem::liquidPhaseIdx, ParentType::enthalpy(fluidState, paramCache, FluidSystem::liquidPhaseIdx));
+        fluidState.setEnthalpy(FluidSystem::gasPhaseIdx, ParentType::enthalpy(fluidState, paramCache, FluidSystem::gasPhaseIdx));
     }
 
     /*!
@@ -279,7 +248,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar saturation(const int phaseIdx = wPhaseIdx) const
+    Scalar saturation(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
     { return fluidState_.saturation(phaseIdx); }
 
     /*!
@@ -288,7 +257,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar density(const int phaseIdx = wPhaseIdx) const
+    Scalar density(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
     { return fluidState_.density(phaseIdx); }
 
     /*!
@@ -302,7 +271,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar pressure(const int phaseIdx = wPhaseIdx) const
+    Scalar pressure(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
     { return fluidState_.pressure(phaseIdx); }
 
     /*!
@@ -316,7 +285,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar mobility(const int phaseIdx = wPhaseIdx) const
+    Scalar mobility(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
     { return relativePermeability(phaseIdx)/fluidState_.viscosity(phaseIdx); }
 
     /*!
@@ -326,8 +295,8 @@ public:
      * \param phaseIdx The index of the fluid phase
      * \note The non-wetting phase is infinitely mobile
      */
-    Scalar viscosity(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? fluidState_.viscosity(wPhaseIdx) : 0.0; }
+    Scalar viscosity(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
+    { return phaseIdx == FluidSystem::liquidPhaseIdx ? fluidState_.viscosity(FluidSystem::liquidPhaseIdx) : 0.0; }
 
     /*!
      * \brief Returns relative permeability [-] of a given phase within
@@ -335,8 +304,8 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar relativePermeability(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? relativePermeabilityWetting_ : 1.0; }
+    Scalar relativePermeability(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
+    { return phaseIdx == FluidSystem::liquidPhaseIdx ? relativePermeabilityWetting_ : 1.0; }
 
     /*!
      * \brief Returns the effective capillary pressure \f$\mathrm{[Pa]}\f$ within the
@@ -352,7 +321,7 @@ public:
     Scalar capillaryPressure() const
     {
         using std::max;
-        return max(minPc_, pressure(nPhaseIdx) - pressure(wPhaseIdx));
+        return max(minPc_, pressure(FluidSystem::gasPhaseIdx) - pressure(FluidSystem::liquidPhaseIdx));
     }
 
     /*!
@@ -369,8 +338,8 @@ public:
      *       manually do a conversion. It is not correct if the density is not constant
      *       or the gravity different
      */
-    Scalar pressureHead(const int phaseIdx = wPhaseIdx) const
-    { return 100.0 *(pressure(phaseIdx) - pressure(nPhaseIdx))/density(phaseIdx)/9.81; }
+    Scalar pressureHead(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
+    { return 100.0 *(pressure(phaseIdx) - pressure(FluidSystem::gasPhaseIdx))/density(phaseIdx)/9.81; }
 
     /*!
      * \brief Returns the water content
@@ -383,7 +352,7 @@ public:
      * \note this function is here as a convenience to the user to not have to
      *       manually do a conversion.
      */
-    Scalar waterContent(const int phaseIdx = wPhaseIdx) const
+    Scalar waterContent(const int phaseIdx = FluidSystem::liquidPhaseIdx) const
     { return saturation(phaseIdx) * porosity_; }
 
     /*!
@@ -395,8 +364,8 @@ public:
      */
     Scalar moleFraction(const int phaseIdx, const int compIdx) const
     {
-        assert(enableWaterDiffusionInAir);
-        if (compIdx != wCompIdx)
+        assert(enableWaterDiffusionInAir());
+        if (compIdx != FluidSystem::comp0Idx)
             DUNE_THROW(Dune::InvalidStateException, "There is only one component for Richards!");
         return moleFraction_[phaseIdx];
     }
@@ -409,7 +378,7 @@ public:
      */
     Scalar molarDensity(const int phaseIdx) const
     {
-        assert(enableWaterDiffusionInAir);
+        assert(enableWaterDiffusionInAir());
         return molarDensity_[phaseIdx];
     }
 
@@ -421,7 +390,7 @@ public:
      */
     Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
     {
-        assert(enableWaterDiffusionInAir && phaseIdx == nPhaseIdx && compIdx == wCompIdx);
+        assert(enableWaterDiffusionInAir() && phaseIdx == FluidSystem::gasPhaseIdx && compIdx == FluidSystem::comp0Idx);
         return diffCoeff_;
     }
 
@@ -431,8 +400,8 @@ protected:
     Scalar porosity_; //!< the porosity
     PermeabilityType permeability_; //!< the instrinsic permeability
     Scalar minPc_; //!< the minimum capillary pressure (entry pressure)
-    Scalar moleFraction_[numPhases]; //!< The water mole fractions in water and air
-    Scalar molarDensity_[numPhases]; //!< The molar density of water and air
+    Scalar moleFraction_[ParentType::numPhases()]; //!< The water mole fractions in water and air
+    Scalar molarDensity_[ParentType::numPhases()]; //!< The molar density of water and air
     Scalar diffCoeff_; //!< The binary diffusion coefficient of water in air
 };
 
diff --git a/dumux/porousmediumflow/richards/vtkoutputfields.hh b/dumux/porousmediumflow/richards/vtkoutputfields.hh
index 3506564e988a7286763ccb5f2ec1ec7e4228e993..baf1139d791672d174141a6ab3f14a535097c88f 100644
--- a/dumux/porousmediumflow/richards/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/richards/vtkoutputfields.hh
@@ -24,7 +24,6 @@
 #ifndef DUMUX_RICHARDS_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_RICHARDS_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/common/parameters.hh>
 
 namespace Dumux {
@@ -33,31 +32,32 @@ namespace Dumux {
  * \ingroup RichardsModel
  * \brief Adds vtk output fields specific to the Richards model.
  */
-template<class Indices, bool enableWaterDiffusionInAir>
+template<bool enableWaterDiffusionInAir>
 class RichardsVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
+        using FluidSystem = typename VtkOutputModule::VolumeVariables::FluidSystem;
+
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::liquidPhaseIdx); }, "Sw");
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::gasPhaseIdx); }, "Sn");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::liquidPhaseIdx); }, "pw");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::gasPhaseIdx); }, "pn");
         vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc");
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "density");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobility");
-        vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(Indices::wPhaseIdx); }, "kr");
+        vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::liquidPhaseIdx); }, "density");
+        vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::liquidPhaseIdx); }, "mobility");
+        vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(FluidSystem::liquidPhaseIdx); }, "kr");
         vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
 
         static const bool gravity = getParamFromGroup<bool>(vtk.paramGroup(), "Problem.EnableGravity");
 
         if(gravity)
-            vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(Indices::wPhaseIdx); }, "pressure head");
+            vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(FluidSystem::liquidPhaseIdx); }, "pressure head");
         if (enableWaterDiffusionInAir)
             vtk.addVolumeVariable([](const auto& v){ return v.moleFraction(1, 0); }, "x^w_air");
-        vtk.addVolumeVariable([](const auto& v){ return v.waterContent(Indices::wPhaseIdx); },"water content");
+        vtk.addVolumeVariable([](const auto& v){ return v.waterContent(FluidSystem::liquidPhaseIdx); },"water content");
 
         vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phasePresence");
     }
diff --git a/dumux/porousmediumflow/richardsnc/indices.hh b/dumux/porousmediumflow/richardsnc/indices.hh
index efaac711e0c945de167191dbd345a661784d67c2..2cf18ab8cd88bb2aaaa90d577a8e8d4cb6a947d3 100644
--- a/dumux/porousmediumflow/richardsnc/indices.hh
+++ b/dumux/porousmediumflow/richardsnc/indices.hh
@@ -26,36 +26,32 @@
 #ifndef DUMUX_RICHARDSNC_INDICES_HH
 #define DUMUX_RICHARDSNC_INDICES_HH
 
-namespace Dumux
-{
-// \{
+namespace Dumux {
 
 /*!
  * \ingroup RichardsNCModel
  * \brief The indices for the isothermal Richards, n-component model.
+ * \tparam fluidSystemPhaseIdx The index of the fluid phase in the fluid system
  */
-template <int PVOffset = 0>
+template<int phaseIdx>
 struct RichardsNCIndices
 {
-
-    //! Set the index of the phases for accessing the volvars
-    static const int wPhaseIdx = 0;
-    static const int nPhaseIdx = 1;
-
     //! Component indices
-    static const int compMainIdx = PVOffset + 0; //!< main component index
+    static constexpr int compMainIdx = 0; //!< main component index
 
     //! primary variable indices
-    static const int pressureIdx = PVOffset + 0; //!< pressure
+    static constexpr int pressureIdx = 0; //!< pressure
+
+    //! the index of the fluid phase in the fluid system
+    static constexpr int fluidSystemPhaseIdx = phaseIdx;
 
     //! \note These indices make sense if the first balance is replaced by the
     //!       total mass balance.
 
     //! Equation indices
-    static const int conti0EqIdx = PVOffset + 0; //!< continuity equation index
+    static constexpr int conti0EqIdx = 0; //!< continuity equation index
 };
 
-// \}
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh
index c5d450e3d82f6c1cba3813adfd769ea26365c795..9b0074b149adfffd29c9b33d6e2a15486ac27520 100644
--- a/dumux/porousmediumflow/richardsnc/model.hh
+++ b/dumux/porousmediumflow/richardsnc/model.hh
@@ -84,21 +84,27 @@
 #include <dumux/porousmediumflow/nonisothermal/indices.hh>
 #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh>
 
+#include <dumux/porousmediumflow/richards/model.hh>
+
 #include "volumevariables.hh"
 #include "indices.hh"
 #include "vtkoutputfields.hh"
 
-namespace Dumux
-{
+namespace Dumux {
+
 /*!
  * \ingroup RichardsNCModel
  * \brief Specifies a number properties of the Richards n-components model.
  *
  * \tparam nComp the number of components to be considered.
+ * \tparam useMol whether to use mass or mole balances
+ * \tparam fluidSystemPhaseIdx The index of the fluid phase in the fluid system
  */
-template<int nComp>
+template<int nComp, bool useMol, int fluidSystemPhaseIdx>
 struct RichardsNCModelTraits
 {
+    using Indices = RichardsNCIndices<fluidSystemPhaseIdx>;
+
     static constexpr int numEq() { return nComp; }
     static constexpr int numPhases() { return 1; }
     static constexpr int numComponents() { return nComp; }
@@ -106,10 +112,11 @@ struct RichardsNCModelTraits
     static constexpr bool enableAdvection() { return true; }
     static constexpr bool enableMolecularDiffusion() { return true; }
     static constexpr bool enableEnergyBalance() { return false; }
+
+    static constexpr bool useMoles() { return useMol; }
 };
 
-namespace Properties
-{
+namespace Properties {
 
 //////////////////////////////////////////////////////////////////
 // Type tags
@@ -131,9 +138,12 @@ SET_PROP(RichardsNC, ModelTraits)
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 public:
-    using type = RichardsNCModelTraits<FluidSystem::numComponents>;
+    using type = RichardsNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, PhaseIdx)>;
 };
 
+ //! The default phase index to access the fluid system
+SET_INT_PROP(RichardsNC, PhaseIdx, 0);
+
 //! Define that per default mole fractions are used in the balance equations
 SET_BOOL_PROP(RichardsNC, UseMoles, true);
 
@@ -144,8 +154,20 @@ SET_TYPE_PROP(RichardsNC, LocalResidual, CompositionalLocalResidual<TypeTag>);
 //! the total mass balance, i.e. the phase balance
 SET_INT_PROP(RichardsNC, ReplaceCompEqIdx, 0);
 
-//! define the VolumeVariables
-SET_TYPE_PROP(RichardsNC, VolumeVariables, RichardsNCVolumeVariables<TypeTag>);
+//! Set the volume variables property
+SET_PROP(RichardsNC, VolumeVariables)
+{
+private:
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using FST = typename GET_PROP_TYPE(TypeTag, FluidState);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType;
+
+    using Traits = RichardsVolumeVariablesTraits<PV, FSY, FST, PT, MT>;
+public:
+    using type = RichardsNCVolumeVariables<Traits>;
+};
 
 //! The default richardsnc model computes no diffusion in the air phase
 //! Turning this on leads to the extended Richards equation (see e.g. Vanderborght et al. 2017)
@@ -174,56 +196,30 @@ SET_PROP(RichardsNC, FluidState)
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using type = CompositionalFluidState<Scalar, FluidSystem>;
 };
-//! Set the vtk output fields specific to this model
-SET_PROP(RichardsNC, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 
-public:
-    using type = RichardsNCVtkOutputFields<FluidSystem, Indices>;
-};
+//! Set the vtk output fields specific to this model
+SET_TYPE_PROP(RichardsNC, VtkOutputFields, RichardsNCVtkOutputFields);
 
-//! Set the indices used
-SET_TYPE_PROP(RichardsNC, Indices, RichardsNCIndices<>);
 //! The spatial parameters to be employed.
 //! Use FVSpatialParamsOneP by default.
 SET_TYPE_PROP(RichardsNC, SpatialParams, FVSpatialParamsOneP<TypeTag>);
 
 //! The model after Millington (1961) is used for the effective diffusivity
-SET_PROP(RichardsNC, EffectiveDiffusivityModel)
-{
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using type = DiffusivityMillingtonQuirk<Scalar>;
-};
+SET_TYPE_PROP(RichardsNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
 //! average is used as default model to compute the effective thermal heat conductivity
-SET_PROP(RichardsNCNI, ThermalConductivityModel)
-{
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using type = ThermalConductivityAverage<Scalar>;
-};
+SET_TYPE_PROP(RichardsNCNI, ThermalConductivityModel, ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
 //////////////////////////////////////////////////////////////////
 // Property values for non-isothermal Richards n-components model
 //////////////////////////////////////////////////////////////////
 
-//! set non-isothermal Indices
-SET_PROP(RichardsNCNI, Indices)
-{
-private:
-    static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq();
-public:
-    using type = EnergyIndices<RichardsNCIndices<>, numEq, 0>;
-};
-
 //! set non-isothermal model traits
 SET_PROP(RichardsNCNI, ModelTraits)
 {
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using IsothermalTraits = RichardsNCModelTraits<FluidSystem::numComponents>;
+    using IsothermalTraits = RichardsNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, PhaseIdx)>;
 public:
     using type = PorousMediumFlowNIModelTraits<IsothermalTraits>;
 };
diff --git a/dumux/porousmediumflow/richardsnc/volumevariables.hh b/dumux/porousmediumflow/richardsnc/volumevariables.hh
index cb12812843d6a462b98a67f56ee56ad73123b8fa..e3c05f0ce28f44a2456c7f129d0f8112f3ee3b45 100644
--- a/dumux/porousmediumflow/richardsnc/volumevariables.hh
+++ b/dumux/porousmediumflow/richardsnc/volumevariables.hh
@@ -25,9 +25,6 @@
 #ifndef DUMUX_RICHARDSNC_VOLUME_VARIABLES_HH
 #define DUMUX_RICHARDSNC_VOLUME_VARIABLES_HH
 
-#include <dune/common/fvector.hh>
-
-#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/volumevariables.hh>
 
 namespace Dumux {
@@ -37,33 +34,28 @@ namespace Dumux {
  * \brief  Contains the quantities which are constant within a
  *        finite volume in the Richards, n-component model.
  */
-template <class TypeTag>
-class RichardsBaseVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class RichardsNCVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, RichardsNCVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
-    using PermeabilityType = typename SpatialParams::PermeabilityType;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    enum{
-         pressureIdx = Indices::pressureIdx,
-         wPhaseIdx = Indices::wPhaseIdx
-    };
-
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, RichardsNCVolumeVariables<Traits>>;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    using PermeabilityType = typename Traits::PermeabilityType;
+    using Idx = typename Traits::ModelTraits::Indices;
 
-public:
+    static constexpr int fluidSystemPhaseIdx = Idx::fluidSystemPhaseIdx;
+    static constexpr bool useMoles = Traits::ModelTraits::useMoles();
 
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
+public:
+    //! export type of the fluid system
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export type of the fluid state
+    using FluidState = typename Traits::FluidState;
+    //! export indices
+    using Indices = typename Traits::ModelTraits::Indices;
+    //! export phase acess indices
+    static constexpr int liquidPhaseIdx = fluidSystemPhaseIdx;
+    static constexpr int gasPhaseIdx = 1 - liquidPhaseIdx;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -74,20 +66,21 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume& scv)
+                const Scv& scv)
     {
         ParentType::update(elemSol, problem, element, scv);
 
-        Implementation::completeFluidState(elemSol, problem, element, scv, fluidState_);
+        completeFluidState(elemSol, problem, element, scv, fluidState_);
         //////////
         // specify the other parameters
         //////////
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
-        relativePermeabilityWetting_ = MaterialLaw::krw(materialParams, fluidState_.saturation(wPhaseIdx));
+        relativePermeabilityWetting_ = MaterialLaw::krw(materialParams, fluidState_.saturation(fluidSystemPhaseIdx));
 
         // precompute the minimum capillary pressure (entry pressure)
         // needed to make sure we don't compute unphysical capillary pressures and thus saturations
@@ -95,6 +88,22 @@ public:
         pn_ = problem.nonWettingReferencePressure();
         porosity_ = problem.spatialParams().porosity(element, scv, elemSol);
         permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
+
+        // Second instance of a parameter cache.
+        // Could be avoided if diffusion coefficients also
+        // became part of the fluid state.
+        typename FluidSystem::ParameterCache paramCache;
+        paramCache.updatePhase(fluidState_, fluidSystemPhaseIdx);
+
+        const int compIIdx = fluidSystemPhaseIdx;
+        for (unsigned int compJIdx = 0; compJIdx < ParentType::numComponents(); ++compJIdx)
+            if(compIIdx != compJIdx)
+                setDiffusionCoefficient_(compJIdx,
+                                         FluidSystem::binaryDiffusionCoefficient(fluidState_,
+                                                                                 paramCache,
+                                                                                 fluidSystemPhaseIdx,
+                                                                                 compIIdx,
+                                                                                 compJIdx));
     }
 
     /*!
@@ -110,11 +119,11 @@ public:
      * \param scv The subcontrol volume.
      * \param fluidState The fluid state to fill.
      */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution& elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static void completeFluidState(const ElemSol& elemSol,
                                    const Problem& problem,
                                    const Element& element,
-                                   const SubControlVolume& scv,
+                                   const Scv& scv,
                                    FluidState& fluidState)
     {
         Scalar t = ParentType::temperature(elemSol, problem, element, scv);
@@ -124,25 +133,43 @@ public:
         const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
 
         // set the wetting pressure
-        fluidState.setPressure(wPhaseIdx, priVars[pressureIdx]);
+        fluidState.setPressure(fluidSystemPhaseIdx, priVars[Indices::pressureIdx]);
 
         // compute the capillary pressure to compute the saturation
         // make sure that we the capillary pressure is not smaller than the minimum pc
         // this would possibly return unphysical values from regularized material laws
         using std::max;
+        using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
         const Scalar pc = max(MaterialLaw::endPointPc(materialParams),
-                              problem.nonWettingReferencePressure() - fluidState.pressure(wPhaseIdx));
+                              problem.nonWettingReferencePressure() - fluidState.pressure(fluidSystemPhaseIdx));
         const Scalar sw = MaterialLaw::sw(materialParams, pc);
-        fluidState.setSaturation(wPhaseIdx, sw);
+        fluidState.setSaturation(fluidSystemPhaseIdx, sw);
+
+        // set the mole/mass fractions
+        if(useMoles)
+        {
+            Scalar sumSecondaryFractions = 0.0;
+            for (int compIdx = 1; compIdx < ParentType::numComponents(); ++compIdx)
+            {
+                fluidState.setMoleFraction(fluidSystemPhaseIdx, compIdx, priVars[compIdx]);
+                sumSecondaryFractions += priVars[compIdx];
+            }
+            fluidState.setMoleFraction(fluidSystemPhaseIdx, 0, 1.0 - sumSecondaryFractions);
+        }
+        else
+        {
+            for (int compIdx = 1; compIdx < ParentType::numComponents(); ++compIdx)
+                fluidState.setMassFraction(fluidSystemPhaseIdx, compIdx, priVars[compIdx]);
+        }
 
         // density and viscosity
         typename FluidSystem::ParameterCache paramCache;
         paramCache.updateAll(fluidState);
-        fluidState.setDensity(wPhaseIdx, FluidSystem::density(fluidState, paramCache, wPhaseIdx));
-        fluidState.setViscosity(wPhaseIdx, FluidSystem::viscosity(fluidState, paramCache, wPhaseIdx));
+        fluidState.setDensity(fluidSystemPhaseIdx, FluidSystem::density(fluidState, paramCache, fluidSystemPhaseIdx));
+        fluidState.setViscosity(fluidSystemPhaseIdx, FluidSystem::viscosity(fluidState, paramCache, fluidSystemPhaseIdx));
 
         // compute and set the enthalpy
-        fluidState.setEnthalpy(wPhaseIdx, Implementation::enthalpy(fluidState, paramCache, wPhaseIdx));
+        fluidState.setEnthalpy(fluidSystemPhaseIdx, ParentType::enthalpy(fluidState, paramCache, fluidSystemPhaseIdx));
     }
 
     /*!
@@ -183,8 +210,8 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar saturation(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? fluidState_.saturation(wPhaseIdx) : 1.0-fluidState_.saturation(wPhaseIdx); }
+    Scalar saturation(const int phaseIdx = fluidSystemPhaseIdx) const
+    { return phaseIdx == fluidSystemPhaseIdx ? fluidState_.saturation(fluidSystemPhaseIdx) : 1.0-fluidState_.saturation(fluidSystemPhaseIdx); }
 
     /*!
      * \brief Returns the average mass density \f$\mathrm{[kg/m^3]}\f$ of a given
@@ -192,8 +219,8 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar density(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? fluidState_.density(phaseIdx) : 0.0; }
+    Scalar density(const int phaseIdx = fluidSystemPhaseIdx) const
+    { return phaseIdx == fluidSystemPhaseIdx ? fluidState_.density(phaseIdx) : 0.0; }
 
     /*!
      * \brief Returns the effective pressure \f$\mathrm{[Pa]}\f$ of a given phase within
@@ -206,8 +233,8 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar pressure(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? fluidState_.pressure(phaseIdx) : pn_; }
+    Scalar pressure(const int phaseIdx = fluidSystemPhaseIdx) const
+    { return phaseIdx == fluidSystemPhaseIdx ? fluidState_.pressure(phaseIdx) : pn_; }
 
     /*!
      * \brief Returns the effective mobility \f$\mathrm{[1/(Pa*s)]}\f$ of a given phase within
@@ -220,7 +247,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar mobility(const int phaseIdx = wPhaseIdx) const
+    Scalar mobility(const int phaseIdx = fluidSystemPhaseIdx) const
     { return relativePermeability(phaseIdx)/fluidState_.viscosity(phaseIdx); }
 
     /*!
@@ -230,8 +257,8 @@ public:
      * \param phaseIdx The index of the fluid phase
      * \note The non-wetting phase is infinitely mobile
      */
-    Scalar viscosity(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? fluidState_.viscosity(wPhaseIdx) : 0.0; }
+    Scalar viscosity(const int phaseIdx = fluidSystemPhaseIdx) const
+    { return phaseIdx == fluidSystemPhaseIdx ? fluidState_.viscosity(fluidSystemPhaseIdx) : 0.0; }
 
     /*!
      * \brief Returns relative permeability [-] of a given phase within
@@ -239,8 +266,8 @@ public:
      *
      * \param phaseIdx The index of the fluid phase
      */
-    Scalar relativePermeability(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? relativePermeabilityWetting_ : 1.0; }
+    Scalar relativePermeability(const int phaseIdx = fluidSystemPhaseIdx) const
+    { return phaseIdx == fluidSystemPhaseIdx ? relativePermeabilityWetting_ : 1.0; }
 
     /*!
      * \brief Returns the effective capillary pressure \f$\mathrm{[Pa]}\f$ within the
@@ -256,7 +283,7 @@ public:
     Scalar capillaryPressure() const
     {
         using std::max;
-        return max(minPc_, pn_ - fluidState_.pressure(wPhaseIdx));
+        return max(minPc_, pn_ - fluidState_.pressure(fluidSystemPhaseIdx));
     }
 
     /*!
@@ -273,7 +300,7 @@ public:
      *       manually do a conversion. It is not correct if the density is not constant
      *       or the gravity different
      */
-    Scalar pressureHead(const int phaseIdx = wPhaseIdx) const
+    Scalar pressureHead(const int phaseIdx = fluidSystemPhaseIdx) const
     { return 100.0 *(pressure(phaseIdx) - pn_)/density(phaseIdx)/9.81; }
 
     /*!
@@ -287,143 +314,16 @@ public:
      * \note this function is here as a convenience to the user to not have to
      *       manually do a conversion.
      */
-    Scalar waterContent(const int phaseIdx = wPhaseIdx) const
+    Scalar waterContent(const int phaseIdx = fluidSystemPhaseIdx) const
     { return saturation(phaseIdx) * porosity_; }
 
-protected:
-    FluidState fluidState_; //!< the fluid state
-    Scalar relativePermeabilityWetting_; //!< the relative permeability of the wetting phase
-    Scalar porosity_; //!< the porosity
-    PermeabilityType permeability_; //!< the instrinsic permeability
-    Scalar pn_; //!< the reference non-wetting pressure
-    Scalar minPc_; //!< the minimum capillary pressure (entry pressure)
-};
-
-/*!
- * \ingroup RichardsNCModel
- * \brief Contains the quantities which are constant within a
- *        finite volume in the Richards, n-component model.
- */
-template <class TypeTag>
-class RichardsNCVolumeVariables : public RichardsBaseVolumeVariables<TypeTag>
-{
-    using ParentType = RichardsBaseVolumeVariables<TypeTag>;
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    static_assert(!GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir), "Water diffusion in air is not implement for RichardsNC");
-
-    enum
-    {
-        wPhaseIdx = Indices::wPhaseIdx,
-        pressureIdx = Indices::pressureIdx
-    };
-
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-    static const int dimWorld = GridView::dimensionworld;
-    static const int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents();
-
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-    using Element = typename GridView::template Codim<0>::Entity;
-
-public:
-
-    using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
-
-    /*!
-     * \brief Update all quantities for a given control volume
-     *
-     * \param elemSol A vector containing all primary variables connected to the element
-     * \param problem The object specifying the problem which ought to
-     *                be simulated
-     * \param element An element which contains part of the control volume
-     * \param scv The sub-control volume
-     */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
-                const Problem &problem,
-                const Element &element,
-                const SubControlVolume &scv)
-    {
-        ParentType::update(elemSol, problem, element, scv);
-
-        //calculate all secondary variables from the primary variables and store results in fluidstate
-        Implementation::completeFluidState(elemSol, problem, element, scv, this->fluidState_);
-
-        // Second instance of a parameter cache.
-        // Could be avoided if diffusion coefficients also
-        // became part of the fluid state.
-        typename FluidSystem::ParameterCache paramCache;
-        paramCache.updatePhase(this->fluidState_, wPhaseIdx);
-
-        const int compIIdx = wPhaseIdx;
-        for (unsigned int compJIdx = 0; compJIdx < numComponents; ++compJIdx)
-            if(compIIdx != compJIdx)
-                setDiffusionCoefficient_(compJIdx,
-                                         FluidSystem::binaryDiffusionCoefficient(this->fluidState_,
-                                                                                 paramCache,
-                                                                                 wPhaseIdx,
-                                                                                 compIIdx,
-                                                                                 compJIdx));
-    }
-
-    /*!
-     * \brief Fill the fluid state according to the primary variables.
-     *
-     * Taking the information from the primary variables,
-     * the fluid state is filled with every information that is
-     * necessary to evaluate the model's local residual.
-     *
-     * \param elemSol A vector containing all primary variables connected to the element.
-     * \param problem The problem at hand.
-     * \param element The current element.
-     * \param scv The subcontrol volume.
-     * \param fluidState The fluid state to fill.
-     */
-    template<class ElementSolution>
-    static void completeFluidState(const ElementSolution &elemSol,
-                                   const Problem& problem,
-                                   const Element& element,
-                                   const SubControlVolume &scv,
-                                   FluidState& fluidState)
-    {
-        ParentType::completeFluidState(elemSol, problem, element, scv, fluidState);
-
-        const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
-
-        // set the mole/mass fractions
-        if(useMoles)
-        {
-            Scalar sumSecondaryFractions = 0.0;
-            for (int compIdx = 1; compIdx < numComponents; ++compIdx)
-            {
-                fluidState.setMoleFraction(wPhaseIdx, compIdx, priVars[compIdx]);
-                sumSecondaryFractions += priVars[compIdx];
-            }
-            fluidState.setMoleFraction(wPhaseIdx, 0, 1.0 - sumSecondaryFractions);
-        }
-        else
-        {
-            for (int compIdx = 1; compIdx < numComponents; ++compIdx)
-                fluidState.setMassFraction(wPhaseIdx, compIdx, priVars[compIdx]);
-        }
-    }
-
     /*!
      * \brief Return molar density \f$\mathrm{[mol/m^3]}\f$ the of the fluid phase.
      *
      * We always forward to the fluid state with the phaseIdx property (see class description).
      */
-    Scalar molarDensity(const int phaseIdx = wPhaseIdx) const
-    { return phaseIdx == wPhaseIdx ? this->fluidState_.molarDensity(phaseIdx) : 0.0; }
+    Scalar molarDensity(const int phaseIdx = fluidSystemPhaseIdx) const
+    { return phaseIdx == fluidSystemPhaseIdx ? this->fluidState_.molarDensity(phaseIdx) : 0.0; }
 
     /*!
      * \brief Return mole fraction \f$\mathrm{[mol/mol]}\f$ of a component in the phase.
@@ -434,7 +334,7 @@ public:
      * We always forward to the fluid state with the phaseIdx property (see class description).
      */
     Scalar moleFraction(const int phaseIdx, const int compIdx) const
-    { return phaseIdx == wPhaseIdx ? this->fluidState_.moleFraction(phaseIdx, compIdx) : 0.0; }
+    { return phaseIdx == fluidSystemPhaseIdx ? this->fluidState_.moleFraction(phaseIdx, compIdx) : 0.0; }
 
     /*!
      * \brief Return mass fraction \f$\mathrm{[kg/kg]}\f$ of a component in the phase.
@@ -445,7 +345,7 @@ public:
      * We always forward to the fluid state with the phaseIdx property (see class description).
      */
     Scalar massFraction(const int phaseIdx, const int compIdx) const
-    { return phaseIdx == wPhaseIdx ? this->fluidState_.massFraction(phaseIdx, compIdx) : 0.0; }
+    { return phaseIdx == fluidSystemPhaseIdx ? this->fluidState_.massFraction(phaseIdx, compIdx) : 0.0; }
 
     /*!
      * \brief Return concentration \f$\mathrm{[mol/m^3]}\f$  of a component in the phase.
@@ -456,7 +356,7 @@ public:
      * We always forward to the fluid state with the phaseIdx property (see class description).
      */
     Scalar molarity(const int phaseIdx, const int compIdx) const
-    { return phaseIdx == wPhaseIdx ? this->fluidState_.molarity(phaseIdx, compIdx) : 0.0; }
+    { return phaseIdx == fluidSystemPhaseIdx ? this->fluidState_.molarity(phaseIdx, compIdx) : 0.0; }
 
     /*!
      * \brief Return the binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ in the fluid.
@@ -465,17 +365,10 @@ public:
      * \param compIdx The index of the component
      */
     Scalar diffusionCoefficient(const int phaseIdx, const int compIdx) const
-    {
-        assert(phaseIdx == wPhaseIdx);
-        assert(compIdx > wPhaseIdx);
-        return diffCoefficient_[compIdx-1];
-    }
+    { return diffCoefficient_[compIdx-1]; }
 
-    /*!
-     * \brief Returns the dispersivity of the fluid's streamlines.
-     */
-    const GlobalPosition &dispersivity() const
-    { return dispersivity_; }
+protected:
+    FluidState fluidState_; //!< the fluid state
 
 private:
     /*!
@@ -485,13 +378,15 @@ private:
      * \param compIdx The index of the component
      */
     void setDiffusionCoefficient_(int compIdx, Scalar d)
-    {
-        assert(compIdx > wPhaseIdx);
-        diffCoefficient_[compIdx-1] = d;
-    }
+    { diffCoefficient_[compIdx-1] = d; }
+
+    std::array<Scalar, ParentType::numComponents()-1> diffCoefficient_;
 
-    std::array<Scalar, numComponents-1> diffCoefficient_;
-    GlobalPosition dispersivity_;
+    Scalar relativePermeabilityWetting_; //!< the relative permeability of the wetting phase
+    Scalar porosity_; //!< the porosity
+    PermeabilityType permeability_; //!< the instrinsic permeability
+    Scalar pn_; //!< the reference non-wetting pressure
+    Scalar minPc_; //!< the minimum capillary pressure (entry pressure)
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh b/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh
index 223fc039eae079d42aaa96f6203ae226c1421700..8d760dfa8ec7e71f2e70f767f5afb56c495ccff3 100644
--- a/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh
@@ -24,40 +24,40 @@
 #ifndef DUMUX_RICHARDSNC_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_RICHARDSNC_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/porousmediumflow/richards/vtkoutputfields.hh>
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup RichardsNCModel
  * \brief Adds vtk output fields specific to the Richards model.
  */
-template<class FluidSystem, class Indices>
 class RichardsNCVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, "Sw");
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, "Sn");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, "pw");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, "pn");
         vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc");
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "density");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobility");
-        vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(Indices::wPhaseIdx); }, "kr");
+        vtk.addVolumeVariable([](const auto& v){ return v.density(VolumeVariables::liquidPhaseIdx); }, "density");
+        vtk.addVolumeVariable([](const auto& v){ return v.mobility(VolumeVariables::liquidPhaseIdx); }, "mobility");
+        vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, "kr");
         vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
         vtk.addVolumeVariable([](const auto& v){ return v.temperature(); }, "temperature");
 
         static const bool gravity = getParamFromGroup<bool>(vtk.paramGroup(), "Problem.EnableGravity");
         if(gravity)
-            vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(Indices::wPhaseIdx); }, "pressure head");
-        vtk.addVolumeVariable([](const auto& v){ return v.waterContent(Indices::wPhaseIdx); },"water content");
+            vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); }, "pressure head");
+        vtk.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); },"water content");
 
-        for (int k = 0; k < FluidSystem::numComponents; ++k)
-            vtk.addVolumeVariable([k](const auto& v){ return v.moleFraction(Indices::wPhaseIdx, k); }, "x^" + FluidSystem::phaseName(Indices::wPhaseIdx) + "_" + FluidSystem::componentName(k));
+        for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx)
+            vtk.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); },
+                                  "x^" + FluidSystem::phaseName(VolumeVariables::liquidPhaseIdx) + "_" + FluidSystem::componentName(compIdx));
 
     }
 };
diff --git a/dumux/porousmediumflow/sequential/cellcentered/pressure.hh b/dumux/porousmediumflow/sequential/cellcentered/pressure.hh
index cffcca65dea5a2d6e0ad3a06d70703bc7f5b5f52..32de8e8f3b77fbb2384f297989aef8fcb15b6f14 100644
--- a/dumux/porousmediumflow/sequential/cellcentered/pressure.hh
+++ b/dumux/porousmediumflow/sequential/cellcentered/pressure.hh
@@ -66,7 +66,7 @@ template<class TypeTag> class FVPressure
     using SolutionTypes = typename GET_PROP(TypeTag, SolutionTypes);
     using PrimaryVariables = typename SolutionTypes::PrimaryVariables;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
 protected:
 
diff --git a/dumux/porousmediumflow/sequential/properties.hh b/dumux/porousmediumflow/sequential/properties.hh
index d153c0e1b01583fe06ea6f953bb0562313cc5c48..858eaefdbfd516c6dac0116add440d4440b93397 100644
--- a/dumux/porousmediumflow/sequential/properties.hh
+++ b/dumux/porousmediumflow/sequential/properties.hh
@@ -116,6 +116,7 @@ SET_PROP(SequentialModel, ModelTraits)
 private:
     struct DummyTraits
     {
+        using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
         static constexpr int numEq() { return GET_PROP_VALUE(TypeTag, NumEq); }
     };
 public:
diff --git a/dumux/porousmediumflow/tracer/indices.hh b/dumux/porousmediumflow/tracer/indices.hh
index 71e67488a2e92ffcc94e52cd0f307a2ad5af5b3b..920d509717d31a4ba1e583acd9df40ab48af84fb 100644
--- a/dumux/porousmediumflow/tracer/indices.hh
+++ b/dumux/porousmediumflow/tracer/indices.hh
@@ -25,15 +25,14 @@
 #ifndef DUMUX_TRACER_INDICES_HH
 #define DUMUX_TRACER_INDICES_HH
 
-namespace Dumux
-{
+namespace Dumux {
+
 // \{
 
 /*!
  * \ingroup TracerModel
  * \brief Defines the primary variable and equation indices used by the isothermal tracer model.
  */
-template <int PVOffset = 0>
 struct TracerIndices
 {
     /*!
@@ -41,7 +40,7 @@ struct TracerIndices
      * primary variable indices are just numbered by component index
      * Equation indices
      */
-    static const int transportEqIdx = PVOffset + 0; //!< transport equation index
+    static const int transportEqIdx = 0; //!< transport equation index
 };
 
 // \}
diff --git a/dumux/porousmediumflow/tracer/model.hh b/dumux/porousmediumflow/tracer/model.hh
index 105c49a8add5daf28145b97f6a80f3a076d4a582..52e3cddff253d3002aa440426c08237e79a99409 100644
--- a/dumux/porousmediumflow/tracer/model.hh
+++ b/dumux/porousmediumflow/tracer/model.hh
@@ -61,17 +61,20 @@
 #include "vtkoutputfields.hh"
 #include "localresidual.hh"
 
-namespace Dumux
-{
+namespace Dumux {
+
 /*!
- * \ingroup RichardsNCModel
+ * \ingroup TracerModel
  * \brief Specifies a number properties of the Richards n-components model.
  *
  * \tparam nComp the number of components to be considered.
+ * \tparam useMol whether mole or mass balances are used
  */
-template<int nComp>
+template<int nComp, bool useMol>
 struct TracerModelTraits
 {
+    using Indices = TracerIndices;
+
     static constexpr int numEq() { return nComp; }
     static constexpr int numPhases() { return 1; }
     static constexpr int numComponents() { return nComp; }
@@ -79,11 +82,28 @@ struct TracerModelTraits
     static constexpr bool enableAdvection() { return true; }
     static constexpr bool enableMolecularDiffusion() { return true; }
     static constexpr bool enableEnergyBalance() { return false; }
+
+    static constexpr bool useMoles() { return useMol; }
 };
 
-// \{
-namespace Properties
+/*!
+ * \ingroup TracerModel
+ * \brief Traits class for the volume variables of the single-phase model.
+ *
+ * \tparam PV The type used for primary variables
+ * \tparam FSY The fluid system type
+ * \tparam MT The model traits
+ */
+template<class PV, class FSY, class MT>
+struct TracerVolumeVariablesTraits
 {
+    using PrimaryVariables = PV;
+    using FluidSystem = FSY;
+    using ModelTraits = MT;
+};
+
+// \{
+namespace Properties {
 
 //////////////////////////////////////////////////////////////////
 // Type tags
@@ -105,30 +125,31 @@ SET_PROP(Tracer, ModelTraits)
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 public:
-    using type = TracerModelTraits<FluidSystem::numComponents>;
+    using type = TracerModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles)>;
 };
 
 //! Use the tracer local residual function for the tracer model
 SET_TYPE_PROP(Tracer, LocalResidual, TracerLocalResidual<TypeTag>);
 
 //! Set the vtk output fields specific to this model
-SET_PROP(Tracer, VtkOutputFields)
+SET_TYPE_PROP(Tracer, VtkOutputFields, TracerVtkOutputFields);
+
+//! Set the volume variables property
+SET_PROP(Tracer, VolumeVariables)
 {
 private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+
+    using Traits = TracerVolumeVariablesTraits<PV, FSY, MT>;
 public:
-    using type = TracerVtkOutputFields<FluidSystem>;
+    using type = TracerVolumeVariables<Traits>;
 };
 
-//! define the VolumeVariables
-SET_TYPE_PROP(Tracer, VolumeVariables, TracerVolumeVariables<TypeTag>);
-
 //! We use darcy's law as the default for the advective fluxes
 SET_TYPE_PROP(Tracer, AdvectionType, StationaryVelocityField<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
-//! Set the indices used by the tracer model
-SET_TYPE_PROP(Tracer, Indices, TracerIndices<>);
-
 //! Use FVSpatialParamsOneP by default.
 SET_TYPE_PROP(Tracer, SpatialParams, FVSpatialParamsOneP<TypeTag>);
 
diff --git a/dumux/porousmediumflow/tracer/volumevariables.hh b/dumux/porousmediumflow/tracer/volumevariables.hh
index 38022c9b2935e72f386aaab0a1d0d4975e1857b9..12e9d1641beed83e52c30ae8a2b4d6283f251d46 100644
--- a/dumux/porousmediumflow/tracer/volumevariables.hh
+++ b/dumux/porousmediumflow/tracer/volumevariables.hh
@@ -24,9 +24,6 @@
 #ifndef DUMUX_TRACER_VOLUME_VARIABLES_HH
 #define DUMUX_TRACER_VOLUME_VARIABLES_HH
 
-#include <dune/common/fvector.hh>
-
-#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/volumevariables.hh>
 
 namespace Dumux {
@@ -35,25 +32,19 @@ namespace Dumux {
  * \ingroup TracerModel
  * \brief Contains the quantities which are constant within a
  *        finite volume for the tracer model.
- * \todo: We need a scalar, vector, tensor type -> Scalar + dimWorld should be good template params
- *        Furthermore, we need the fluid system and stuff like useMoles -> ModelTraits?
  */
-template <class TypeTag>
-class TracerVolumeVariables : public PorousMediumFlowVolumeVariables<TypeTag>
+template <class Traits>
+class TracerVolumeVariables
+: public PorousMediumFlowVolumeVariables<Traits, TracerVolumeVariables<Traits>>
 {
-    using ParentType = PorousMediumFlowVolumeVariables<TypeTag>;
-
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-
-    static constexpr int dimWorld = GridView::dimensionworld;
-    static constexpr int numComponents = FluidSystem::numComponents;
+    using ParentType = PorousMediumFlowVolumeVariables<Traits, TracerVolumeVariables<Traits>>;
 
-    using GlobalPosition = Dune::FieldVector<Scalar,dimWorld>;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
+    static constexpr bool useMoles = Traits::ModelTraits::useMoles();
 
 public:
+    //! export fluid system type
+    using FluidSystem = typename Traits::FluidSystem;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -64,24 +55,23 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
      */
-    template<class ElementSolution, class Problem,
-             class Element, class SubControlVolume>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume &scv)
+                const Scv &scv)
     {
         // update parent type sets primary variables
         ParentType::update(elemSol, problem, element, scv);
 
         porosity_ = problem.spatialParams().porosity(element, scv, elemSol);
-        dispersivity_ = problem.spatialParams().dispersivity(element, scv, elemSol);
+        // dispersivity_ = problem.spatialParams().dispersivity(element, scv, elemSol);
 
         // the spatial params special to the tracer model
         fluidDensity_ = problem.spatialParams().fluidDensity(element, scv);
         fluidMolarMass_ = problem.spatialParams().fluidMolarMass(element, scv);
 
-        for (int compIdx = 0; compIdx < numComponents; ++compIdx)
+        for (int compIdx = 0; compIdx < ParentType::numComponents(); ++compIdx)
         {
             moleOrMassFraction_[compIdx] = this->priVars()[compIdx];
             diffCoeff_[compIdx] = FluidSystem::binaryDiffusionCoefficient(compIdx, problem, element, scv);
@@ -164,11 +154,12 @@ public:
     Scalar diffusionCoefficient(int pIdx, int compIdx) const
     { return diffCoeff_[compIdx]; }
 
-    /*!
-     * \brief Returns the dispersivity of the fluid's streamlines.
-     */
-    const GlobalPosition &dispersivity() const
-    { return dispersivity_; }
+    // /*!
+    //  * \brief Returns the dispersivity of the fluid's streamlines.
+    //  * \todo implement me
+    //  */
+    // const DispersivityType &dispersivity() const
+    // { return dispersivity_; }
 
     /*!
      * \brief Return the average porosity \f$\mathrm{[-]}\f$ within the control volume.
@@ -179,9 +170,9 @@ public:
 protected:
     Scalar porosity_;    // Effective porosity within the control volume
     Scalar fluidDensity_, fluidMolarMass_;
-    GlobalPosition dispersivity_;
-    std::array<Scalar, numComponents> diffCoeff_;
-    std::array<Scalar, numComponents> moleOrMassFraction_;
+    // DispersivityType dispersivity_;
+    std::array<Scalar, ParentType::numComponents()> diffCoeff_;
+    std::array<Scalar, ParentType::numComponents()> moleOrMassFraction_;
 };
 
 } // end namespace Dumux
diff --git a/dumux/porousmediumflow/tracer/vtkoutputfields.hh b/dumux/porousmediumflow/tracer/vtkoutputfields.hh
index d8c4b1d48dae3e12d0f3ce108728f5bbdf1368e5..7fd8bc6b0d59fc4811caf5f8741a7b5183d12574 100644
--- a/dumux/porousmediumflow/tracer/vtkoutputfields.hh
+++ b/dumux/porousmediumflow/tracer/vtkoutputfields.hh
@@ -24,25 +24,23 @@
 #ifndef DUMUX_TRACER_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_TRACER_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup TracerModel
  * \brief Adds vtk output fields specific to the tracer model
  */
-template<class FluidSystem>
 class TracerVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
         // register standardized vtk output fields
-        for (int compIdx = 0; compIdx < FluidSystem::numComponents; ++compIdx)
+        for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx)
         {
             vtk.addVolumeVariable( [compIdx](const auto& v){  return v.moleFraction(0, compIdx); },
                                    "x_" + std::string(FluidSystem::componentName(compIdx)));
diff --git a/dumux/porousmediumflow/volumevariables.hh b/dumux/porousmediumflow/volumevariables.hh
index 397a4b0f4f04e675b7a74905c0c9f7af6e4fffee..589b590c118c32054a94b6613430deaf21837560 100644
--- a/dumux/porousmediumflow/volumevariables.hh
+++ b/dumux/porousmediumflow/volumevariables.hh
@@ -30,7 +30,7 @@
 namespace Dumux {
 
 // forward declaration
-template <class TypeTag, bool enableEnergyBalance>
+template<class Traits, class Impl, bool enableEnergyBalance>
 class PorousMediumFlowVolumeVariablesImplementation;
 
 /*!
@@ -38,27 +38,35 @@ class PorousMediumFlowVolumeVariablesImplementation;
  * \brief Base class for the model specific class which provides
  *        access to all volume averaged quantities. The volume variables base class
  *        is specialized for isothermal and non-isothermal models.
+ *
+ * \tparam Traits The volume variables traits
+ * \tparam Impl The implementation of the volume variables
  */
-template <class TypeTag>
-using PorousMediumFlowVolumeVariables = PorousMediumFlowVolumeVariablesImplementation<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableEnergyBalance()>;
+template<class Traits, class Impl>
+using PorousMediumFlowVolumeVariables = PorousMediumFlowVolumeVariablesImplementation<Traits, Impl, Traits::ModelTraits::enableEnergyBalance()>;
 
 /*!
  * \ingroup PorousmediumFlow
  * \brief The isothermal base class
+ *
+ * \tparam Traits The volume variables traits
+ * \tparam Impl The implementation of the volume variables
  */
-template<class TypeTag>
-class PorousMediumFlowVolumeVariablesImplementation<TypeTag, false>
+template<class Traits, class Impl>
+class PorousMediumFlowVolumeVariablesImplementation<Traits, Impl, false>
 {
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
 
 public:
-    //! export the primary variables type
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    //! export the type used for the primary variables
+    using PrimaryVariables = typename Traits::PrimaryVariables;
+    //! export the type encapsulating primary variable indices
+    using Indices = typename Traits::ModelTraits::Indices;
+
+    //! return number of phases considered by the model
+    static constexpr int numPhases() { return Traits::ModelTraits::numPhases(); }
+    //! return number of components considered by the model
+    static constexpr int numComponents() { return Traits::ModelTraits::numComponents(); }
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -69,11 +77,11 @@ public:
      * \param element An element which contains part of the control volume
      * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume &scv)
+                const Scv &scv)
     {
         priVars_ = extractDofPriVars(elemSol, scv);
         extrusionFactor_ = problem.extrusionFactor(element, scv, elemSol);
@@ -81,10 +89,13 @@ public:
 
     /*!
      * \brief Returns the primary variables at the dof associated with a given scv.
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param scv The sub-control volume
      */
-    template<class ElementSolution>
-    static const PrimaryVariables& extractDofPriVars(const ElementSolution& elemSol,
-                                                     const SubControlVolume& scv)
+    template<class ElemSol, class Scv>
+    static const PrimaryVariables& extractDofPriVars(const ElemSol& elemSol,
+                                                     const Scv& scv)
     { return elemSol[scv.indexInElement()]; }
 
     /*!
@@ -114,11 +125,11 @@ public:
     { return extrusionFactor_; }
 
     //! The temperature is obtained from the problem as a constant for isothermal models
-    template<class ElementSolution>
-    static Scalar temperature(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static Scalar temperature(const ElemSol &elemSol,
                               const Problem& problem,
                               const Element &element,
-                              const SubControlVolume &scv)
+                              const Scv &scv)
     {
         return problem.temperatureAtPos(scv.dofPosition());
     }
@@ -138,25 +149,27 @@ private:
     Scalar extrusionFactor_;
 };
 
-//! The non-isothermal implicit volume variables base class
-template <class TypeTag>
-class PorousMediumFlowVolumeVariablesImplementation<TypeTag, true>
-: public PorousMediumFlowVolumeVariablesImplementation<TypeTag, false>
+/*!
+ * \ingroup PorousmediumFlow
+ * \brief  The non-isothermal base class
+ *
+ * \tparam Traits The volume variables traits
+ * \tparam Impl The implementation of the volume variables
+ */
+template<class Traits, class Impl>
+class PorousMediumFlowVolumeVariablesImplementation<Traits, Impl, true>
+: public PorousMediumFlowVolumeVariablesImplementation<Traits, Impl, false>
 {
-    using ParentType = PorousMediumFlowVolumeVariablesImplementation<TypeTag, false>;
-    using Implementation = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Element = typename GridView::template Codim<0>::Entity;
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-    static const int temperatureIdx = Indices::temperatureIdx;
+    using ParentType = PorousMediumFlowVolumeVariablesImplementation<Traits, Impl, false>;
+    using Scalar = typename Traits::PrimaryVariables::value_type;
 
 public:
+    //! export the type used for the primary variables
+    using PrimaryVariables = typename Traits::PrimaryVariables;
+    //! export the underlying fluid system
+    using FluidSystem = typename Traits::FluidSystem;
+    //! export the type encapsulating primary variable indices
+    using Indices = typename Traits::ModelTraits::Indices;
 
     /*!
      * \brief Update all quantities for a given control volume
@@ -168,11 +181,11 @@ public:
      * \param fvGeometry The finite volume geometry for the element
      * \param scvIdx Local index of the sub control volume which is inside the element
      */
-    template<class ElementSolution>
-    void update(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void update(const ElemSol &elemSol,
                 const Problem &problem,
                 const Element &element,
-                const SubControlVolume &scv)
+                const Scv &scv)
     {
         ParentType::update(elemSol, problem, element, scv);
 
@@ -228,13 +241,13 @@ public:
     { return solidThermalConductivity_; }
 
     //! The temperature is a primary variable for non-isothermal models
-    template<class ElementSolution>
-    static Scalar temperature(const ElementSolution &elemSol,
+    template<class ElemSol, class Problem, class Element, class Scv>
+    static Scalar temperature(const ElemSol &elemSol,
                               const Problem& problem,
                               const Element &element,
-                              const SubControlVolume &scv)
+                              const Scv &scv)
     {
-        return ParentType::extractDofPriVars(elemSol, scv)[temperatureIdx];
+        return ParentType::extractDofPriVars(elemSol, scv)[Indices::temperatureIdx];
     }
 
     //! The phase enthalpy is zero for isothermal models
@@ -248,10 +261,8 @@ public:
     }
 
 protected:
-    const Implementation &asImp_() const
-    { return *static_cast<const Implementation*>(this); }
-    Implementation &asImp_()
-    { return *static_cast<Implementation*>(this); }
+    const Impl &asImp_() const { return *static_cast<const Impl*>(this); }
+    Impl &asImp_() { return *static_cast<Impl*>(this); }
 
 private:
     Scalar solidHeatCapacity_;
diff --git a/test/freeflow/navierstokes/CMakeLists.txt b/test/freeflow/navierstokes/CMakeLists.txt
index 213f56f960be3f4e845245d8e72a59c7c6e6632a..172941835429ee8a0e11d215435ceb169dd38625 100644
--- a/test/freeflow/navierstokes/CMakeLists.txt
+++ b/test/freeflow/navierstokes/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_input_file_links()
-
+set(CMAKE_BUILD_TYPE Debug)
 add_executable(test_closedsystem EXCLUDE_FROM_ALL test_closedsystem.cc)
 
 dune_add_test(NAME test_navierstokes_liddrivencavity_re1
diff --git a/test/freeflow/navierstokes/angelitestproblem.hh b/test/freeflow/navierstokes/angelitestproblem.hh
index e448c1817869bd30c9d9db407fc220e4dc495819..55339910b6214412f784ee08ea9a154821be81ed 100644
--- a/test/freeflow/navierstokes/angelitestproblem.hh
+++ b/test/freeflow/navierstokes/angelitestproblem.hh
@@ -30,6 +30,7 @@
 #include <dumux/freeflow/navierstokes/problem.hh>
 #include <dumux/discretization/staggered/freeflow/properties.hh>
 #include <dumux/freeflow/navierstokes/model.hh>
+#include "l2error.hh"
 
 namespace Dumux
 {
@@ -73,35 +74,19 @@ class AngeliTestProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
-        // Grid and world dimension
-        dim = GridView::dimension,
-        dimWorld = GridView::dimensionworld
-    };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx
-    };
-
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using TimeLoopPtr = std::shared_ptr<TimeLoop<Scalar>>;
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
+    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
+
 public:
     AngeliTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry), eps_(1e-6)
@@ -130,15 +115,16 @@ public:
     {
         if(printL2Error_)
         {
-            const auto l2error = calculateL2Error(curSol);
-            const int numCellCenterDofs = this->fvGridGeometry().gridView().size(0);
-            const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
+            using L2Error = NavierStokesTestL2Error<Scalar, ModelTraits, PrimaryVariables>;
+            const auto l2error = L2Error::calculateL2Error(*this, curSol);
+            const int numCellCenterDofs = this->fvGridGeometry().numCellCenterDofs();
+            const int numFaceDofs = this->fvGridGeometry().numFaceDofs();
             std::cout << std::setprecision(8) << "** L2 error (abs/rel) for "
                     << std::setw(6) << numCellCenterDofs << " cc dofs and " << numFaceDofs << " face dofs (total: " << numCellCenterDofs + numFaceDofs << "): "
                     << std::scientific
-                    << "L2(p) = " << l2error.first[pressureIdx] << " / " << l2error.second[pressureIdx]
-                    << ", L2(vx) = " << l2error.first[velocityXIdx] << " / " << l2error.second[velocityXIdx]
-                    << ", L2(vy) = " << l2error.first[velocityYIdx] << " / " << l2error.second[velocityYIdx]
+                    << "L2(p) = " << l2error.first[Indices::pressureIdx] << " / " << l2error.second[Indices::pressureIdx]
+                    << ", L2(vx) = " << l2error.first[Indices::velocityXIdx] << " / " << l2error.second[Indices::velocityXIdx]
+                    << ", L2(vy) = " << l2error.first[Indices::velocityYIdx] << " / " << l2error.second[Indices::velocityYIdx]
                     << std::endl;
         }
     }
@@ -179,10 +165,11 @@ public:
         BoundaryTypes values;
 
         // set Dirichlet values for the velocity everywhere
-        values.setDirichlet(momentumBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
 
-        // set a fixed pressure in one cell
-        values.setDirichletCell(totalMassBalanceIdx);
+        // set a fixed pressure in all cells at the boundary
+        values.setDirichletCell(Indices::conti0EqIdx);
 
         return values;
     }
@@ -212,9 +199,9 @@ public:
 
         PrimaryVariables values;
 
-        values[pressureIdx] = - 0.25 * std::exp(-10.0 * kinematicViscosity_ * M_PI * M_PI * t) * M_PI * M_PI * (4.0 * std::cos(2.0 * M_PI * x) + std::cos(4.0 * M_PI * y));
-        values[velocityXIdx] = - 2.0 * M_PI * std::exp(- 5.0 * kinematicViscosity_ * M_PI * M_PI * t) * std::cos(M_PI * x) * std::sin(2.0 * M_PI * y);
-        values[velocityYIdx] = M_PI * std::exp(- 5.0 * kinematicViscosity_ * M_PI * M_PI * t) * std::sin(M_PI * x) * std::cos(2.0 * M_PI * y);
+        values[Indices::pressureIdx] = - 0.25 * std::exp(-10.0 * kinematicViscosity_ * M_PI * M_PI * t) * M_PI * M_PI * (4.0 * std::cos(2.0 * M_PI * x) + std::cos(4.0 * M_PI * y));
+        values[Indices::velocityXIdx] = - 2.0 * M_PI * std::exp(- 5.0 * kinematicViscosity_ * M_PI * M_PI * t) * std::cos(M_PI * x) * std::sin(2.0 * M_PI * y);
+        values[Indices::velocityYIdx] = M_PI * std::exp(- 5.0 * kinematicViscosity_ * M_PI * M_PI * t) * std::sin(M_PI * x) * std::cos(2.0 * M_PI * y);
 
         return values;
     }
@@ -236,79 +223,6 @@ public:
         return analyticalSolution(globalPos, -timeLoop_->timeStepSize());
     }
 
-
-   /*!
-     * \brief Calculate the L2 error between the analytical solution and the numerical approximation.
-     *
-     */
-    auto calculateL2Error(const SolutionVector& curSol) const
-    {
-        PrimaryVariables sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
-
-        const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
-
-        std::vector<Scalar> staggeredVolume(numFaceDofs);
-        std::vector<Scalar> errorVelocity(numFaceDofs);
-        std::vector<Scalar> velocityReference(numFaceDofs);
-        std::vector<int> directionIndex(numFaceDofs);
-
-        Scalar totalVolume = 0.0;
-
-        for (const auto& element : elements(this->fvGridGeometry().gridView()))
-        {
-            auto fvGeometry = localView(this->fvGridGeometry());
-            fvGeometry.bindElement(element);
-
-            for (auto&& scv : scvs(fvGeometry))
-            {
-                // treat cell-center dofs
-                const auto dofIdxCellCenter = scv.dofIndex();
-                const auto& posCellCenter = scv.dofPosition();
-                const auto analyticalSolutionCellCenter = dirichletAtPos(posCellCenter)[pressureIdx];
-                const auto numericalSolutionCellCenter = curSol[FVGridGeometry::cellCenterIdx()][dofIdxCellCenter][pressureIdx];
-                sumError[pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume();
-                sumReference[pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume();
-                totalVolume += scv.volume();
-
-                // treat face dofs
-                for (auto&& scvf : scvfs(fvGeometry))
-                {
-                    const int dofIdxFace = scvf.dofIndex();
-                    const int dirIdx = scvf.directionIndex();
-                    const auto analyticalSolutionFace = dirichletAtPos(scvf.center())[Indices::velocity(dirIdx)];
-                    const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][momentumBalanceIdx];
-                    directionIndex[dofIdxFace] = dirIdx;
-                    errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace);
-                    velocityReference[dofIdxFace] = squaredDiff_(analyticalSolutionFace, 0.0);
-                    const Scalar staggeredHalfVolume = 0.5 * scv.volume();
-                    staggeredVolume[dofIdxFace] = staggeredVolume[dofIdxFace] + staggeredHalfVolume;
-                }
-            }
-        }
-
-        // get the absolute and relative discrete L2-error for cell-center dofs
-        l2NormAbs[pressureIdx] = std::sqrt(sumError[pressureIdx] / totalVolume);
-        l2NormRel[pressureIdx] = std::sqrt(sumError[pressureIdx] / sumReference[pressureIdx]);
-
-        // get the absolute and relative discrete L2-error for face dofs
-        for(int i = 0; i < numFaceDofs; ++i)
-        {
-            const int dirIdx = directionIndex[i];
-            const auto error = errorVelocity[i];
-            const auto ref = velocityReference[i];
-            const auto volume = staggeredVolume[i];
-            sumError[Indices::velocity(dirIdx)] += error * volume;
-            sumReference[Indices::velocity(dirIdx)] += ref * volume;
-        }
-
-        for(int dirIdx = 0; dirIdx < dimWorld; ++dirIdx)
-        {
-            l2NormAbs[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / totalVolume);
-            l2NormRel[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / sumReference[Indices::velocity(dirIdx)]);
-        }
-        return std::make_pair(l2NormAbs, l2NormRel);
-    }
-
    /*!
      * \brief Returns the analytical solution for the pressure
      */
@@ -373,21 +287,15 @@ public:
                     analyticalVelocityOnFace_[faceDofIdx][dirIdx] = analyticalSolutionAtFace[Indices::velocity(dirIdx)];
                 }
 
-                analyticalPressure_[ccDofIdx] = analyticalSolutionAtCc[pressureIdx];
+                analyticalPressure_[ccDofIdx] = analyticalSolutionAtCc[Indices::pressureIdx];
 
-                for(int dirIdx = 0; dirIdx < dim; ++dirIdx)
+                for(int dirIdx = 0; dirIdx < ModelTraits::dim(); ++dirIdx)
                     analyticalVelocity_[ccDofIdx][dirIdx] = analyticalSolutionAtCc[Indices::velocity(dirIdx)];
             }
         }
     }
 
-    private:
-
-    template<class T>
-    T squaredDiff_(const T& a, const T& b) const
-    {
-        return (a-b)*(a-b);
-    }
+private:
 
     bool isLowerLeftCell_(const GlobalPosition& globalPos) const
     {
diff --git a/test/freeflow/navierstokes/channeltestproblem.hh b/test/freeflow/navierstokes/channeltestproblem.hh
index a60d2b6704c7d6fab3545708b4c3d50f7794fc72..1ba906080c105f8ed1341d538655c7d9ab552d65 100644
--- a/test/freeflow/navierstokes/channeltestproblem.hh
+++ b/test/freeflow/navierstokes/channeltestproblem.hh
@@ -85,33 +85,16 @@ class ChannelTestProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum { dimWorld = GridView::dimensionworld };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-#if NONISOTHERMAL
-        temperatureIdx = Indices::temperatureIdx,
-        energyBalanceIdx = Indices::energyBalanceIdx,
-#endif
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx
-    };
-
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-
     using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
 
 public:
@@ -166,23 +149,25 @@ public:
         BoundaryTypes values;
 
         // set Dirichlet values for the velocity everywhere
-        values.setDirichlet(momentumBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
 
 #if NONISOTHERMAL
         if(isInlet(globalPos))
-            values.setDirichlet(energyBalanceIdx);
+            values.setDirichlet(Indices::energyBalanceIdx);
         else
-            values.setOutflow(energyBalanceIdx);
+            values.setOutflow(Indices::energyBalanceIdx);
 #endif
 
         // set a fixed pressure in one cell
         if (isOutlet(globalPos))
         {
-            values.setDirichlet(totalMassBalanceIdx);
-            values.setOutflow(momentumBalanceIdx);
+            values.setDirichlet(Indices::conti0EqIdx);
+            values.setOutflow(Indices::momentumXBalanceIdx);
+            values.setOutflow(Indices::momentumYBalanceIdx);
         }
         else
-            values.setOutflow(totalMassBalanceIdx);
+            values.setOutflow(Indices::conti0EqIdx);
 
         return values;
     }
@@ -199,11 +184,11 @@ public:
 
         if(isInlet(globalPos))
         {
-            values[velocityXIdx] = inletVelocity_;
+            values[Indices::velocityXIdx] = inletVelocity_;
 #if NONISOTHERMAL
         // give the system some time so that the pressure can equilibrate, then start the injection of the hot liquid
         if(time() >= 200.0)
-            values[temperatureIdx] = 293.15;
+            values[Indices::temperatureIdx] = 293.15;
 #endif
         }
 
@@ -225,12 +210,12 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values;
-        values[pressureIdx] = 1.1e+5;
-        values[velocityXIdx] = 0.0;
-        values[velocityYIdx] = 0.0;
+        values[Indices::pressureIdx] = 1.1e+5;
+        values[Indices::velocityXIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
 #if NONISOTHERMAL
-        values[temperatureIdx] = 283.15;
+        values[Indices::temperatureIdx] = 283.15;
 #endif
 
         return values;
diff --git a/test/freeflow/navierstokes/closedsystemtestproblem.hh b/test/freeflow/navierstokes/closedsystemtestproblem.hh
index 0d642001a8600215e7581adbfe9424aeef3580cd..bc088ec6ee6ba4716419a05c61432d9c3014c824 100644
--- a/test/freeflow/navierstokes/closedsystemtestproblem.hh
+++ b/test/freeflow/navierstokes/closedsystemtestproblem.hh
@@ -70,30 +70,16 @@ class ClosedSystemTestProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum { dimWorld = GridView::dimensionworld };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx
-    };
-
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
-
 public:
     ClosedSystemTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry), eps_(1e-6)
@@ -152,13 +138,14 @@ public:
         BoundaryTypes values;
 
         // set Dirichlet values for the velocity everywhere
-        values.setDirichlet(momentumBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
 
         // set a fixed pressure in one cell
         if (isLowerLeftCell_(globalPos))
-            values.setDirichletCell(totalMassBalanceIdx);
+            values.setDirichletCell(Indices::conti0EqIdx);
         else
-            values.setNeumann(totalMassBalanceIdx);
+            values.setNeumann(Indices::conti0EqIdx);
 
         return values;
     }
@@ -171,12 +158,12 @@ public:
     PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values;
-        values[pressureIdx] = 1.1e+5;
-        values[velocityXIdx] = 0.0;
-        values[velocityYIdx] = 0.0;
+        values[Indices::pressureIdx] = 1.1e+5;
+        values[Indices::velocityXIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
         if(globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_)
-            values[velocityXIdx] = lidVelocity_;
+            values[Indices::velocityXIdx] = lidVelocity_;
 
         return values;
     }
@@ -189,9 +176,9 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values;
-        values[pressureIdx] = 1.0e+5;
-        values[velocityXIdx] = 0.0;
-        values[velocityYIdx] = 0.0;
+        values[Indices::pressureIdx] = 1.0e+5;
+        values[Indices::velocityXIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
         return values;
     }
@@ -205,7 +192,6 @@ private:
         return globalPos[0] < (0.5*cellSizeX_ + eps_) && globalPos[1] < eps_;
     }
 
-
     Scalar eps_;
     Scalar lidVelocity_;
     Scalar cellSizeX_;
diff --git a/test/freeflow/navierstokes/doneatestproblem.hh b/test/freeflow/navierstokes/doneatestproblem.hh
index b7e6243ac560cdedcead5f20aec9785bc2cbf1b1..550ae11f7aca3d001cb7ff00772352e66d86d238 100644
--- a/test/freeflow/navierstokes/doneatestproblem.hh
+++ b/test/freeflow/navierstokes/doneatestproblem.hh
@@ -30,6 +30,7 @@
 #include <dumux/freeflow/navierstokes/problem.hh>
 #include <dumux/discretization/staggered/freeflow/properties.hh>
 #include <dumux/freeflow/navierstokes/model.hh>
+#include "l2error.hh"
 
 
 namespace Dumux
@@ -76,45 +77,23 @@ class DoneaTestProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
-        // Grid and world dimension
-        dim = GridView::dimension,
-        dimWorld = GridView::dimensionworld
-    };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        momentumXBalanceIdx = Indices::momentumXBalanceIdx,
-        momentumYBalanceIdx = Indices::momentumYBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx
-    };
-
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
+    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
+
 public:
     DoneaTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry), eps_(1e-6)
     {
-        name_ = getParam<std::string>("Problem.Name");
-
         printL2Error_ = getParam<bool>("Problem.PrintL2Error");
-
         createAnalyticalSolution_();
     }
 
@@ -123,16 +102,6 @@ public:
      */
     // \{
 
-   /*!
-     * \brief The problem name.
-     *
-     * This is used as a prefix for files generated by the simulation.
-     */
-    std::string name() const
-    {
-        return name_;
-    }
-
     bool shouldWriteRestartFile() const
     {
         return false;
@@ -142,15 +111,16 @@ public:
     {
         if(printL2Error_)
         {
-            const auto l2error = calculateL2Error(curSol);
-            const int numCellCenterDofs = this->fvGridGeometry().gridView().size(0);
-            const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
+            using L2Error = NavierStokesTestL2Error<Scalar, ModelTraits, PrimaryVariables>;
+            const auto l2error = L2Error::calculateL2Error(*this, curSol);
+            const int numCellCenterDofs = this->fvGridGeometry().numCellCenterDofs();
+            const int numFaceDofs = this->fvGridGeometry().numFaceDofs();
             std::cout << std::setprecision(8) << "** L2 error (abs/rel) for "
                     << std::setw(6) << numCellCenterDofs << " cc dofs and " << numFaceDofs << " face dofs (total: " << numCellCenterDofs + numFaceDofs << "): "
                     << std::scientific
-                    << "L2(p) = " << l2error.first[pressureIdx] << " / " << l2error.second[pressureIdx]
-                    << ", L2(vx) = " << l2error.first[velocityXIdx] << " / " << l2error.second[velocityXIdx]
-                    << ", L2(vy) = " << l2error.first[velocityYIdx] << " / " << l2error.second[velocityYIdx]
+                    << "L2(p) = " << l2error.first[Indices::pressureIdx] << " / " << l2error.second[Indices::pressureIdx]
+                    << ", L2(vx) = " << l2error.first[Indices::velocityXIdx] << " / " << l2error.second[Indices::velocityXIdx]
+                    << ", L2(vy) = " << l2error.first[Indices::velocityYIdx] << " / " << l2error.second[Indices::velocityYIdx]
                     << std::endl;
         }
     }
@@ -174,13 +144,13 @@ public:
         Scalar x = globalPos[0];
         Scalar y = globalPos[1];
 
-        source[momentumXBalanceIdx] = (12.0-24.0*y) * x*x*x*x + (-24.0 + 48.0*y)* x*x*x
-                                      + (-48.0*y + 72.0*y*y - 48.0*y*y*y + 12.0)* x*x
-                                      + (-2.0 + 24.0*y - 72.0*y*y + 48.0*y*y*y)*x
-                                      + 1.0 - 4.0*y + 12.0*y*y - 8.0*y*y*y;
-        source[momentumYBalanceIdx] = (8.0 - 48.0*y + 48.0*y*y)*x*x*x + (-12.0 + 72.0*y - 72.0*y*y)*x*x
-                                      + (4.0 - 24.0*y + 48.0*y*y - 48.0*y*y*y + 24.0*y*y*y*y)*x - 12.0*y*y
-                                      + 24.0*y*y*y - 12.0*y*y*y*y;
+        source[Indices::momentumXBalanceIdx] = (12.0-24.0*y) * x*x*x*x + (-24.0 + 48.0*y)* x*x*x
+                                             + (-48.0*y + 72.0*y*y - 48.0*y*y*y + 12.0)* x*x
+                                             + (-2.0 + 24.0*y - 72.0*y*y + 48.0*y*y*y)*x
+                                             + 1.0 - 4.0*y + 12.0*y*y - 8.0*y*y*y;
+        source[Indices::momentumYBalanceIdx] = (8.0 - 48.0*y + 48.0*y*y)*x*x*x + (-12.0 + 72.0*y - 72.0*y*y)*x*x
+                                             + (4.0 - 24.0*y + 48.0*y*y - 48.0*y*y*y + 24.0*y*y*y*y)*x - 12.0*y*y
+                                             + 24.0*y*y*y - 12.0*y*y*y*y;
         return source;
     }
     // \}
@@ -200,8 +170,9 @@ public:
         BoundaryTypes values;
 
         // set Dirichlet values for the velocity and pressure everywhere
-        values.setDirichlet(momentumBalanceIdx);
-        values.setDirichletCell(totalMassBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
+        values.setDirichletCell(Indices::conti0EqIdx);
 
         return values;
     }
@@ -228,9 +199,9 @@ public:
         Scalar y = globalPos[1];
 
         PrimaryVariables values;
-        values[pressureIdx] = x * (1.0-x); // p(x,y) = x(1-x) [Donea2003]
-        values[velocityXIdx] = x*x * (1.0 - x)*(1.0 - x) * (2.0*y - 6.0*y*y + 4.0*y*y*y);
-        values[velocityYIdx] = -1.0*y*y * (1.0 - y)*(1.0 - y) * (2.0*x - 6.0*x*x + 4.0*x*x*x);
+        values[Indices::pressureIdx] = x * (1.0-x); // p(x,y) = x(1-x) [Donea2003]
+        values[Indices::velocityXIdx] = x*x * (1.0 - x)*(1.0 - x) * (2.0*y - 6.0*y*y + 4.0*y*y*y);
+        values[Indices::velocityYIdx] = -1.0*y*y * (1.0 - y)*(1.0 - y) * (2.0*x - 6.0*x*x + 4.0*x*x*x);
 
         return values;
     }
@@ -250,85 +221,13 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
     {
         PrimaryVariables values;
-        values[pressureIdx] = 0.0;
-        values[velocityXIdx] = 0.0;
-        values[velocityYIdx] = 0.0;
+        values[Indices::pressureIdx] = 0.0;
+        values[Indices::velocityXIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
         return values;
     }
 
-   /*!
-     * \brief Calculate the L2 error between the analytical solution and the numerical approximation.
-     *
-     */
-    auto calculateL2Error(const SolutionVector& curSol) const
-    {
-        PrimaryVariables sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
-
-        const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
-
-        std::vector<Scalar> staggeredVolume(numFaceDofs);
-        std::vector<Scalar> errorVelocity(numFaceDofs);
-        std::vector<Scalar> velocityReference(numFaceDofs);
-        std::vector<int> directionIndex(numFaceDofs);
-
-        Scalar totalVolume = 0.0;
-
-        for (const auto& element : elements(this->fvGridGeometry().gridView()))
-        {
-            auto fvGeometry = localView(this->fvGridGeometry());
-            fvGeometry.bindElement(element);
-
-            for (auto&& scv : scvs(fvGeometry))
-            {
-                // treat cell-center dofs
-                const auto dofIdxCellCenter = scv.dofIndex();
-                const auto& posCellCenter = scv.dofPosition();
-                const auto analyticalSolutionCellCenter = analyticalSolution(posCellCenter)[pressureIdx];
-                const auto numericalSolutionCellCenter = curSol[FVGridGeometry::cellCenterIdx()][dofIdxCellCenter][pressureIdx];
-                sumError[pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume();
-                sumReference[pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume();
-                totalVolume += scv.volume();
-
-                // treat face dofs
-                for (auto&& scvf : scvfs(fvGeometry))
-                {
-                    const int dofIdxFace = scvf.dofIndex();
-                    const int dirIdx = scvf.directionIndex();
-                    const auto analyticalSolutionFace = analyticalSolution(scvf.center())[Indices::velocity(dirIdx)];
-                    const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][momentumBalanceIdx];
-                    directionIndex[dofIdxFace] = dirIdx;
-                    errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace);
-                    velocityReference[dofIdxFace] = squaredDiff_(analyticalSolutionFace, 0.0);
-                    const Scalar staggeredHalfVolume = 0.5 * scv.volume();
-                    staggeredVolume[dofIdxFace] = staggeredVolume[dofIdxFace] + staggeredHalfVolume;
-                }
-            }
-        }
-
-        // get the absolute and relative discrete L2-error for cell-center dofs
-        l2NormAbs[pressureIdx] = std::sqrt(sumError[pressureIdx] / totalVolume);
-        l2NormRel[pressureIdx] = std::sqrt(sumError[pressureIdx] / sumReference[pressureIdx]);
-
-        // get the absolute and relative discrete L2-error for face dofs
-        for(int i = 0; i < numFaceDofs; ++i)
-        {
-            const int dirIdx = directionIndex[i];
-            const auto error = errorVelocity[i];
-            const auto ref = velocityReference[i];
-            const auto volume = staggeredVolume[i];
-            sumError[Indices::velocity(dirIdx)] += error * volume;
-            sumReference[Indices::velocity(dirIdx)] += ref * volume;
-        }
-
-        for(int dirIdx = 0; dirIdx < dimWorld; ++dirIdx)
-        {
-            l2NormAbs[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / totalVolume);
-            l2NormRel[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / sumReference[Indices::velocity(dirIdx)]);
-        }
-        return std::make_pair(l2NormAbs, l2NormRel);
-    }
-
    /*!
      * \brief Returns the analytical solution for the pressure
      */
@@ -364,16 +263,15 @@ private:
         analyticalVelocity_.resize(this->fvGridGeometry().numCellCenterDofs());
         analyticalVelocityOnFace_.resize(this->fvGridGeometry().numFaceDofs());
 
-
         for (const auto& element : elements(this->fvGridGeometry().gridView()))
         {
             auto fvGeometry = localView(this->fvGridGeometry());
             fvGeometry.bindElement(element);
             for (auto&& scv : scvs(fvGeometry))
             {
-                const auto ccDofIdx = scv.dofIndex();
-                const auto ccDofPosition = scv.dofPosition();
-                const auto analyticalSolutionAtCc = analyticalSolution(ccDofPosition);
+                auto ccDofIdx = scv.dofIndex();
+                auto ccDofPosition = scv.dofPosition();
+                auto analyticalSolutionAtCc = analyticalSolution(ccDofPosition);
 
                 // velocities on faces
                 for (auto&& scvf : scvfs(fvGeometry))
@@ -385,26 +283,19 @@ private:
                     analyticalVelocityOnFace_[faceDofIdx][dirIdx] = analyticalSolutionAtFace[Indices::velocity(dirIdx)];
                 }
 
-                analyticalPressure_[ccDofIdx] = analyticalSolutionAtCc[pressureIdx];
+                analyticalPressure_[ccDofIdx] = analyticalSolutionAtCc[Indices::pressureIdx];
 
-                for(int dirIdx = 0; dirIdx < dim; ++dirIdx)
+                for(int dirIdx = 0; dirIdx < ModelTraits::dim(); ++dirIdx)
                     analyticalVelocity_[ccDofIdx][dirIdx] = analyticalSolutionAtCc[Indices::velocity(dirIdx)];
             }
         }
-    }
-    template<class T>
-    T squaredDiff_(const T& a, const T& b) const
-    {
-        return (a-b)*(a-b);
-    }
+     }
 
     Scalar eps_;
-    std::string name_;
     bool printL2Error_;
     std::vector<Scalar> analyticalPressure_;
     std::vector<GlobalPosition> analyticalVelocity_;
     std::vector<GlobalPosition> analyticalVelocityOnFace_;
-
 };
 } //end namespace
 
diff --git a/test/freeflow/navierstokes/kovasznaytestproblem.hh b/test/freeflow/navierstokes/kovasznaytestproblem.hh
index 14f45d8dd9ecb30aedc285477914494f2a70a325..24d26dbd9ff459fda85e037b28d3fef1d15dc73c 100644
--- a/test/freeflow/navierstokes/kovasznaytestproblem.hh
+++ b/test/freeflow/navierstokes/kovasznaytestproblem.hh
@@ -30,6 +30,7 @@
 #include <dumux/freeflow/navierstokes/problem.hh>
 #include <dumux/discretization/staggered/freeflow/properties.hh>
 #include <dumux/freeflow/navierstokes/model.hh>
+#include "l2error.hh"
 
 namespace Dumux
 {
@@ -71,35 +72,18 @@ class KovasznayTestProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
-        // Grid and world dimension
-        dim = GridView::dimension,
-        dimWorld = GridView::dimensionworld
-    };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx
-    };
-
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
+    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
+
 public:
     KovasznayTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry), eps_(1e-6)
@@ -133,15 +117,16 @@ public:
     {
         if(printL2Error_)
         {
-            const auto l2error = calculateL2Error(curSol);
-            const int numCellCenterDofs = this->fvGridGeometry().gridView().size(0);
-            const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
+            using L2Error = NavierStokesTestL2Error<Scalar, ModelTraits, PrimaryVariables>;
+            const auto l2error = L2Error::calculateL2Error(*this, curSol);
+            const int numCellCenterDofs = this->fvGridGeometry().numCellCenterDofs();
+            const int numFaceDofs = this->fvGridGeometry().numFaceDofs();
             std::cout << std::setprecision(8) << "** L2 error (abs/rel) for "
                     << std::setw(6) << numCellCenterDofs << " cc dofs and " << numFaceDofs << " face dofs (total: " << numCellCenterDofs + numFaceDofs << "): "
                     << std::scientific
-                    << "L2(p) = " << l2error.first[pressureIdx] << " / " << l2error.second[pressureIdx]
-                    << ", L2(vx) = " << l2error.first[velocityXIdx] << " / " << l2error.second[velocityXIdx]
-                    << ", L2(vy) = " << l2error.first[velocityYIdx] << " / " << l2error.second[velocityYIdx]
+                    << "L2(p) = " << l2error.first[Indices::pressureIdx] << " / " << l2error.second[Indices::pressureIdx]
+                    << ", L2(vx) = " << l2error.first[Indices::velocityXIdx] << " / " << l2error.second[Indices::velocityXIdx]
+                    << ", L2(vy) = " << l2error.first[Indices::velocityYIdx] << " / " << l2error.second[Indices::velocityYIdx]
                     << std::endl;
         }
     }
@@ -182,13 +167,14 @@ public:
         BoundaryTypes values;
 
         // set Dirichlet values for the velocity everywhere
-        values.setDirichlet(momentumBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
 
         // set a fixed pressure in one cell
         if (isLowerLeftCell_(globalPos))
-            values.setDirichletCell(totalMassBalanceIdx);
+            values.setDirichletCell(Indices::conti0EqIdx);
         else
-            values.setOutflow(totalMassBalanceIdx);
+            values.setOutflow(Indices::conti0EqIdx);
 
         return values;
     }
@@ -215,9 +201,9 @@ public:
         Scalar y = globalPos[1];
 
         PrimaryVariables values;
-        values[pressureIdx] = 0.5 * (1.0 - std::exp(2.0 * lambda_ * x));
-        values[velocityXIdx] = 1.0 - std::exp(lambda_ * x) * std::cos(2.0 * M_PI * y);
-        values[velocityYIdx] = 0.5 * lambda_ / M_PI * std::exp(lambda_ * x) * std::sin(2.0 * M_PI * y);
+        values[Indices::pressureIdx] = 0.5 * (1.0 - std::exp(2.0 * lambda_ * x));
+        values[Indices::velocityXIdx] = 1.0 - std::exp(lambda_ * x) * std::cos(2.0 * M_PI * y);
+        values[Indices::velocityYIdx] = 0.5 * lambda_ / M_PI * std::exp(lambda_ * x) * std::sin(2.0 * M_PI * y);
 
         return values;
     }
@@ -237,87 +223,13 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values;
-        values[pressureIdx] = 0.0;
-        values[velocityXIdx] = 0.0;
-        values[velocityYIdx] = 0.0;
+        values[Indices::pressureIdx] = 0.0;
+        values[Indices::velocityXIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
         return values;
     }
 
-
-   /*!
-     * \brief Calculate the L2 error between the analytical solution and the numerical approximation.
-     *
-     * \param curSol Vector containing the current solution
-     */
-    auto calculateL2Error(const SolutionVector& curSol) const
-    {
-        PrimaryVariables sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
-
-        const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
-
-        std::vector<Scalar> staggeredVolume(numFaceDofs);
-        std::vector<Scalar> errorVelocity(numFaceDofs);
-        std::vector<Scalar> velocityReference(numFaceDofs);
-        std::vector<int> directionIndex(numFaceDofs);
-
-        Scalar totalVolume = 0.0;
-
-        for (const auto& element : elements(this->fvGridGeometry().gridView()))
-        {
-            auto fvGeometry = localView(this->fvGridGeometry());
-            fvGeometry.bindElement(element);
-
-            for (auto&& scv : scvs(fvGeometry))
-            {
-                // treat cell-center dofs
-                const auto dofIdxCellCenter = scv.dofIndex();
-                const auto& posCellCenter = scv.dofPosition();
-                const auto analyticalSolutionCellCenter = dirichletAtPos(posCellCenter)[pressureIdx];
-                const auto numericalSolutionCellCenter = curSol[FVGridGeometry::cellCenterIdx()][dofIdxCellCenter][pressureIdx];
-                sumError[pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume();
-                sumReference[pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume();
-                totalVolume += scv.volume();
-
-                // treat face dofs
-                for (auto&& scvf : scvfs(fvGeometry))
-                {
-                    const int dofIdxFace = scvf.dofIndex();
-                    const int dirIdx = scvf.directionIndex();
-                    const auto analyticalSolutionFace = dirichletAtPos(scvf.center())[Indices::velocity(dirIdx)];
-                    const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][momentumBalanceIdx];
-                    directionIndex[dofIdxFace] = dirIdx;
-                    errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace);
-                    velocityReference[dofIdxFace] = squaredDiff_(analyticalSolutionFace, 0.0);
-                    const Scalar staggeredHalfVolume = 0.5 * scv.volume();
-                    staggeredVolume[dofIdxFace] = staggeredVolume[dofIdxFace] + staggeredHalfVolume;
-                }
-            }
-        }
-
-        // get the absolute and relative discrete L2-error for cell-center dofs
-        l2NormAbs[pressureIdx] = std::sqrt(sumError[pressureIdx] / totalVolume);
-        l2NormRel[pressureIdx] = std::sqrt(sumError[pressureIdx] / sumReference[pressureIdx]);
-
-        // get the absolute and relative discrete L2-error for face dofs
-        for(int i = 0; i < numFaceDofs; ++i)
-        {
-            const int dirIdx = directionIndex[i];
-            const auto error = errorVelocity[i];
-            const auto ref = velocityReference[i];
-            const auto volume = staggeredVolume[i];
-            sumError[Indices::velocity(dirIdx)] += error * volume;
-            sumReference[Indices::velocity(dirIdx)] += ref * volume;
-        }
-
-        for(int dirIdx = 0; dirIdx < dimWorld; ++dirIdx)
-        {
-            l2NormAbs[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / totalVolume);
-            l2NormRel[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / sumReference[Indices::velocity(dirIdx)]);
-        }
-        return std::make_pair(l2NormAbs, l2NormRel);
-    }
-
    /*!
      * \brief Returns the analytical solution for the pressure
      */
@@ -373,20 +285,14 @@ private:
                     analyticalVelocityOnFace_[faceDofIdx][dirIdx] = analyticalSolutionAtFace[Indices::velocity(dirIdx)];
                 }
 
-                analyticalPressure_[ccDofIdx] = analyticalSolutionAtCc[pressureIdx];
+                analyticalPressure_[ccDofIdx] = analyticalSolutionAtCc[Indices::pressureIdx];
 
-                for(int dirIdx = 0; dirIdx < dim; ++dirIdx)
+                for(int dirIdx = 0; dirIdx < ModelTraits::dim(); ++dirIdx)
                     analyticalVelocity_[ccDofIdx][dirIdx] = analyticalSolutionAtCc[Indices::velocity(dirIdx)];
             }
         }
     }
 
-    template<class T>
-    T squaredDiff_(const T& a, const T& b) const
-    {
-        return (a-b)*(a-b);
-    }
-
     bool isLowerLeftCell_(const GlobalPosition& globalPos) const
     {
         return globalPos[0] < (this->fvGridGeometry().bBoxMin()[0] + 0.5*cellSizeX_ + eps_);
diff --git a/test/freeflow/navierstokes/l2error.hh b/test/freeflow/navierstokes/l2error.hh
new file mode 100644
index 0000000000000000000000000000000000000000..353a028af70ca82a70abfb7649a80446c569dbee
--- /dev/null
+++ b/test/freeflow/navierstokes/l2error.hh
@@ -0,0 +1,127 @@
+// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+// vi: set et ts=4 sw=4 sts=4:
+/*****************************************************************************
+ *   See the file COPYING for full copying permissions.                      *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ * \ingroup NavierStokesTests
+ * \copydoc Dumux::NavierStokesTestL2Error
+ */
+#ifndef DUMUX_TEST_L2_ERROR_HH
+#define DUMUX_TEST_L2_ERROR_HH
+
+namespace Dumux
+{
+
+/*!
+ * \ingroup NavierStokesTests
+ * \brief  Routines to calculate the discrete L2 error
+ */
+template<class Scalar, class ModelTraits, class PrimaryVariables>
+class NavierStokesTestL2Error
+{
+    using Indices = typename ModelTraits::Indices;
+
+public:
+
+    /*!
+      * \brief Calculate the L2 error between the analytical solution and the numerical approximation.
+      *
+      * \param curSol Vector containing the current solution
+      */
+    template<class Problem, class SolutionVector>
+    static auto calculateL2Error(const Problem& problem, const SolutionVector& curSol)
+    {
+        using FVGridGeometry = std::decay_t<decltype(problem.fvGridGeometry())>;
+        PrimaryVariables sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
+
+        const int numFaceDofs = problem.fvGridGeometry().numFaceDofs();
+
+        std::vector<Scalar> staggeredVolume(numFaceDofs);
+        std::vector<Scalar> errorVelocity(numFaceDofs);
+        std::vector<Scalar> velocityReference(numFaceDofs);
+        std::vector<int> directionIndex(numFaceDofs);
+
+        Scalar totalVolume = 0.0;
+
+        for (const auto& element : elements(problem.fvGridGeometry().gridView()))
+        {
+            auto fvGeometry = localView(problem.fvGridGeometry());
+            fvGeometry.bindElement(element);
+
+            for (auto&& scv : scvs(fvGeometry))
+            {
+                // treat cell-center dofs
+                const auto dofIdxCellCenter = scv.dofIndex();
+                const auto& posCellCenter = scv.dofPosition();
+                const auto analyticalSolutionCellCenter = problem.dirichletAtPos(posCellCenter)[Indices::pressureIdx];
+                const auto numericalSolutionCellCenter = curSol[FVGridGeometry::cellCenterIdx()][dofIdxCellCenter][Indices::pressureIdx - ModelTraits::dim()];
+                sumError[Indices::pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume();
+                sumReference[Indices::pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume();
+                totalVolume += scv.volume();
+
+                // treat face dofs
+                for (auto&& scvf : scvfs(fvGeometry))
+                {
+                    const int dofIdxFace = scvf.dofIndex();
+                    const int dirIdx = scvf.directionIndex();
+                    const auto analyticalSolutionFace = problem.dirichletAtPos(scvf.center())[Indices::velocity(dirIdx)];
+                    const auto numericalSolutionFace = curSol[FVGridGeometry::faceIdx()][dofIdxFace][0];
+                    directionIndex[dofIdxFace] = dirIdx;
+                    errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace);
+                    velocityReference[dofIdxFace] = squaredDiff_(analyticalSolutionFace, 0.0);
+                    const Scalar staggeredHalfVolume = 0.5 * scv.volume();
+                    staggeredVolume[dofIdxFace] = staggeredVolume[dofIdxFace] + staggeredHalfVolume;
+                }
+            }
+        }
+
+        // get the absolute and relative discrete L2-error for cell-center dofs
+        l2NormAbs[Indices::pressureIdx] = std::sqrt(sumError[Indices::pressureIdx] / totalVolume);
+        l2NormRel[Indices::pressureIdx] = std::sqrt(sumError[Indices::pressureIdx] / sumReference[Indices::pressureIdx]);
+
+        // get the absolute and relative discrete L2-error for face dofs
+        for(int i = 0; i < numFaceDofs; ++i)
+        {
+            const int dirIdx = directionIndex[i];
+            const auto error = errorVelocity[i];
+            const auto ref = velocityReference[i];
+            const auto volume = staggeredVolume[i];
+            sumError[Indices::velocity(dirIdx)] += error * volume;
+            sumReference[Indices::velocity(dirIdx)] += ref * volume;
+        }
+
+        for(int dirIdx = 0; dirIdx < ModelTraits::dim(); ++dirIdx)
+        {
+            l2NormAbs[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / totalVolume);
+            l2NormRel[Indices::velocity(dirIdx)] = std::sqrt(sumError[Indices::velocity(dirIdx)] / sumReference[Indices::velocity(dirIdx)]);
+        }
+        return std::make_pair(l2NormAbs, l2NormRel);
+    }
+
+private:
+
+    template<class T>
+    static T squaredDiff_(const T& a, const T& b)
+    {
+        return (a-b)*(a-b);
+    }
+
+};
+} //end namespace DUMUX_TEST_L2_ERROR_HH
+
+#endif
diff --git a/test/freeflow/navierstokes/test_donea.cc b/test/freeflow/navierstokes/test_donea.cc
index acfc16266215fe0addeef62cfa8e26b69dcf8af6..03f60731c4929c6492766f43737d59f6725b6f7f 100644
--- a/test/freeflow/navierstokes/test_donea.cc
+++ b/test/freeflow/navierstokes/test_donea.cc
@@ -161,6 +161,7 @@ int main(int argc, char** argv) try
     nonLinearSolver.solve(x);
 
     // write vtk output
+    problem->postTimeStep(x);
     vtkWriter.write(1.0);
 
     timer.stop();
diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc
index 882aca078b467608847bdc292d2e325079bd6455..019bd257e2b1b7b16f5572d80e0cfc827073d55a 100644
--- a/test/freeflow/navierstokes/test_kovasznay.cc
+++ b/test/freeflow/navierstokes/test_kovasznay.cc
@@ -161,6 +161,7 @@ int main(int argc, char** argv) try
 
     // write vtk output
     vtkWriter.write(1.0);
+    problem->postTimeStep(x);
 
     timer.stop();
 
diff --git a/test/freeflow/navierstokesnc/channeltestproblem.hh b/test/freeflow/navierstokesnc/channeltestproblem.hh
index 2880eedfa312e7dc43dd7a7a09d12c88f423e07d..f72f82451ecb8e691b651a182deefa2f2fb13c30 100644
--- a/test/freeflow/navierstokesnc/channeltestproblem.hh
+++ b/test/freeflow/navierstokesnc/channeltestproblem.hh
@@ -24,9 +24,7 @@
 #ifndef DUMUX_CHANNEL_NC_TEST_PROBLEM_HH
 #define DUMUX_CHANNEL_NC_TEST_PROBLEM_HH
 
-#include <dumux/material/fluidsystems/1pliquid.hh>
 #include <dumux/material/components/simpleh2o.hh>
-#include <dumux/material/components/constant.hh>
 #include <dumux/material/fluidsystems/h2oair.hh>
 
 #include <dumux/freeflow/navierstokes/problem.hh>
@@ -55,7 +53,7 @@ SET_TYPE_PROP(ChannelNCTestTypeTag, FluidSystem,
               FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)/*, SimpleH2O<typename GET_PROP_TYPE(TypeTag, Scalar)>, true*/>);
 
 SET_INT_PROP(ChannelNCTestTypeTag, PhaseIdx,
-             GET_PROP_TYPE(TypeTag, FluidSystem)::wPhaseIdx);
+             GET_PROP_TYPE(TypeTag, FluidSystem)::phase0Idx);
 
 SET_INT_PROP(ChannelNCTestTypeTag, ReplaceCompEqIdx, GET_PROP_VALUE(TypeTag, PhaseIdx));
 
@@ -73,11 +71,7 @@ SET_BOOL_PROP(ChannelNCTestTypeTag, EnableGridVolumeVariablesCache, true);
 // Use mole fraction formulation
 SET_BOOL_PROP(ChannelNCTestTypeTag, UseMoles, true);
 
-// #if ENABLE_NAVIERSTOKES
 SET_BOOL_PROP(ChannelNCTestTypeTag, EnableInertiaTerms, true);
-// #else
-// SET_BOOL_PROP(ChannelNCTestTypeTag, EnableInertiaTerms, false);
-// #endif
 }
 
 /*!
@@ -89,39 +83,19 @@ template <class TypeTag>
 class ChannelNCTestProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum { dimWorld = GridView::dimensionworld };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        transportEqIdx = 1-GET_PROP_VALUE(TypeTag, PhaseIdx),
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx,
-#if NONISOTHERMAL
-        temperatureIdx = Indices::temperatureIdx,
-        energyBalanceIdx = Indices::energyBalanceIdx,
-#endif
-        transportCompIdx = 1-GET_PROP_VALUE(TypeTag, PhaseIdx)
-    };
 
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-
     using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
-    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
-    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
 
 public:
     ChannelNCTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
@@ -174,34 +148,38 @@ public:
      */
     BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportEqIdx = Indices::conti0EqIdx + 1;
         BoundaryTypes values;
 
         if(isInlet(globalPos))
         {
-            values.setDirichlet(momentumBalanceIdx);
-            values.setOutflow(totalMassBalanceIdx);
+            values.setDirichlet(Indices::momentumXBalanceIdx);
+            values.setDirichlet(Indices::momentumYBalanceIdx);
+            values.setOutflow(Indices::conti0EqIdx);
             values.setDirichlet(transportEqIdx);
 #if NONISOTHERMAL
-            values.setDirichlet(energyBalanceIdx);
+            values.setDirichlet(Indices::energyBalanceIdx);
 #endif
         }
         else if(isOutlet(globalPos))
         {
-            values.setOutflow(momentumBalanceIdx);
-            values.setDirichlet(totalMassBalanceIdx);
+            values.setOutflow(Indices::momentumXBalanceIdx);
+            values.setOutflow(Indices::momentumYBalanceIdx);
+            values.setDirichlet(Indices::conti0EqIdx);
             values.setOutflow(transportEqIdx);
 #if NONISOTHERMAL
-            values.setOutflow(energyBalanceIdx);
+            values.setOutflow(Indices::energyBalanceIdx);
 #endif
         }
         else
         {
             // set Dirichlet values for the velocity everywhere
-            values.setDirichlet(momentumBalanceIdx);
-            values.setOutflow(totalMassBalanceIdx);
+            values.setDirichlet(Indices::momentumXBalanceIdx);
+            values.setDirichlet(Indices::momentumYBalanceIdx);
+            values.setOutflow(Indices::conti0EqIdx);
             values.setOutflow(transportEqIdx);
 #if NONISOTHERMAL
-            values.setOutflow(energyBalanceIdx);
+            values.setOutflow(Indices::energyBalanceIdx);
 #endif
         }
 
@@ -216,6 +194,7 @@ public:
      */
     PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1;
         PrimaryVariables values = initialAtPos(globalPos);
 
         // give the system some time so that the pressure can equilibrate, then start the injection of the tracer
@@ -225,7 +204,7 @@ public:
             {
                 values[transportCompIdx] = 1e-3;
 #if NONISOTHERMAL
-            values[temperatureIdx] = 293.15;
+            values[Indices::temperatureIdx] = 293.15;
 #endif
             }
         }
@@ -247,18 +226,19 @@ public:
      */
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1;
         PrimaryVariables values;
-        values[pressureIdx] = 1.1e+5;
+        values[Indices::pressureIdx] = 1.1e+5;
         values[transportCompIdx] = 0.0;
 #if NONISOTHERMAL
-        values[temperatureIdx] = 283.15;
+        values[Indices::temperatureIdx] = 283.15;
 #endif
 
         // parabolic velocity profile
-        values[velocityXIdx] =  inletVelocity_*(globalPos[1] - this->fvGridGeometry().bBoxMin()[1])*(this->fvGridGeometry().bBoxMax()[1] - globalPos[1])
-                               / (0.25*(this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1])*(this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]));
+        values[Indices::velocityXIdx] =  inletVelocity_*(globalPos[1] - this->fvGridGeometry().bBoxMin()[1])*(this->fvGridGeometry().bBoxMax()[1] - globalPos[1])
+                                      / (0.25*(this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1])*(this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]));
 
-        values[velocityYIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
         return values;
     }
@@ -269,6 +249,7 @@ public:
      * \param gridVariables The grid variables
      * \param sol The solution vector
      */
+    template<class GridVariables, class SolutionVector>
     void calculateDeltaP(const GridVariables& gridVariables, const SolutionVector& sol)
     {
         for (const auto& element : elements(this->fvGridGeometry().gridView()))
diff --git a/test/freeflow/navierstokesnc/densityflowproblem.hh b/test/freeflow/navierstokesnc/densityflowproblem.hh
index 071e1d24b3e32b6edc2a345983e5b018fb345442..2e0bfcd0e20c770c14eb56b9ff5852fbe410029e 100644
--- a/test/freeflow/navierstokesnc/densityflowproblem.hh
+++ b/test/freeflow/navierstokesnc/densityflowproblem.hh
@@ -24,9 +24,7 @@
 #ifndef DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH
 #define DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH
 
-#include <dumux/material/fluidsystems/1pliquid.hh>
 #include <dumux/material/components/simpleh2o.hh>
-#include <dumux/material/components/constant.hh>
 #include <dumux/material/fluidsystems/h2oair.hh>
 
 #include <dumux/discretization/staggered/freeflow/properties.hh>
@@ -50,7 +48,7 @@ SET_TYPE_PROP(DensityDrivenFlowTypeTag, FluidSystem,
               FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)/*, SimpleH2O<typename GET_PROP_TYPE(TypeTag, Scalar)>, false*/>);
 
 SET_INT_PROP(DensityDrivenFlowTypeTag, PhaseIdx,
-             GET_PROP_TYPE(TypeTag, FluidSystem)::wPhaseIdx);
+             GET_PROP_TYPE(TypeTag, FluidSystem)::phase0Idx);
 
 SET_INT_PROP(DensityDrivenFlowTypeTag, ReplaceCompEqIdx, GET_PROP_VALUE(TypeTag, PhaseIdx));
 
@@ -83,33 +81,19 @@ template <class TypeTag>
 class DensityDrivenFlowProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum { dimWorld = GridView::dimensionworld };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        transportEqIdx = 1-GET_PROP_VALUE(TypeTag, PhaseIdx),
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx,
-        transportCompIdx = 1-GET_PROP_VALUE(TypeTag, PhaseIdx)
-    };
 
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-
-    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
-    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+    using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
 
 public:
     DensityDrivenFlowProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
@@ -166,15 +150,17 @@ public:
      */
     BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportEqIdx = Indices::conti0EqIdx + 1;
         BoundaryTypes values;
 
         // set Dirichlet values for the velocity everywhere
-        values.setDirichlet(momentumBalanceIdx);
-        values.setOutflow(transportEqIdx);
-        values.setOutflow(totalMassBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
+        values.setNeumann(transportEqIdx);
+        values.setNeumann(Indices::conti0EqIdx);
 
         if(isLowerLeftCell_(globalPos))
-            values.setDirichletCell(totalMassBalanceIdx);
+            values.setDirichletCell(Indices::conti0EqIdx);
 
         if(globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_)
         {
@@ -196,12 +182,13 @@ public:
      */
     PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1;
         PrimaryVariables values;
 
-        values[pressureIdx] = 1.1e+5;
+        values[Indices::pressureIdx] = 1.1e+5;
         values[transportCompIdx] = 1e-3;
-        values[velocityXIdx] = 0.0;
-        values[velocityYIdx] = 0.0;
+        values[Indices::velocityXIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
         return values;
     }
@@ -220,11 +207,12 @@ public:
      */
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1;
         PrimaryVariables values;
-        values[pressureIdx] = 1.1e+5;
+        values[Indices::pressureIdx] = 1.1e+5;
         values[transportCompIdx] = 0.0;
-        values[velocityXIdx] = 0.0;
-        values[velocityYIdx] = 0.0;
+        values[Indices::velocityXIdx] = 0.0;
+        values[Indices::velocityYIdx] = 0.0;
 
         return values;
     }
@@ -235,6 +223,7 @@ public:
      * \param gridVariables The grid variables
      * \param sol The solution vector
      */
+    template<class GridVariables, class SolutionVector>
     void calculateDeltaRho(const GridVariables& gridVariables, const SolutionVector& sol)
     {
         for (const auto& element : elements(this->fvGridGeometry().gridView()))
diff --git a/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh b/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh
index 81d9a8e69a47cf128970da42705251f8f4d4d929..e48ac9c0a5e3d6b923acbb1c59d742716b20c291 100644
--- a/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh
+++ b/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh
@@ -177,32 +177,24 @@ template <class TypeTag>
 class MaxwellStefanNCTestProblem : public NavierStokesProblem<TypeTag>
 {
     using ParentType = NavierStokesProblem<TypeTag>;
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        compTwoIdx = FluidSystem::N2Idx,
-        compThreeIdx = FluidSystem::CO2Idx,
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx,
-    };
 
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
-    using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
+    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
 
-    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
-    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+    enum {
+        compTwoIdx =  Indices::conti0EqIdx + FluidSystem::N2Idx,
+        compThreeIdx = Indices::conti0EqIdx + FluidSystem::CO2Idx,
+    };
 
 public:
     MaxwellStefanNCTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
@@ -225,6 +217,7 @@ public:
      * \param gridVariables The grid variables
      * \param time The time
      */
+     template<class SolutionVector, class GridVariables>
      void postTimeStep(const SolutionVector& curSol,
                        const GridVariables& gridVariables,
                        const Scalar time)
@@ -348,10 +341,11 @@ public:
     {
         BoundaryTypes values;
         // set Dirichlet values for the velocity everywhere
-        values.setDirichlet(momentumBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
         values.setOutflow(compTwoIdx);
         values.setOutflow(compThreeIdx);
-        values.setOutflow(totalMassBalanceIdx);
+        values.setOutflow(Indices::conti0EqIdx);
         return values;
     }
 
@@ -390,9 +384,9 @@ public:
            initialValues[compThreeIdx] = 0.0;
         }
 
-        initialValues[pressureIdx] = 1.1e+5;
-        initialValues[velocityXIdx] = 0.0;
-        initialValues[velocityYIdx] = 0.0;
+        initialValues[Indices::pressureIdx] = 1.1e+5;
+        initialValues[Indices::velocityXIdx] = 0.0;
+        initialValues[Indices::velocityYIdx] = 0.0;
 
         return initialValues;
     }
diff --git a/test/freeflow/rans/pipelauferproblem.hh b/test/freeflow/rans/pipelauferproblem.hh
index c8547eaabfa7cd993651280abf558b2430a0780c..ca74552a2ec161ec0e7e3cbfadc832896f044e25 100644
--- a/test/freeflow/rans/pipelauferproblem.hh
+++ b/test/freeflow/rans/pipelauferproblem.hh
@@ -79,33 +79,17 @@ class PipeLauferProblem : public ZeroEqProblem<TypeTag>
 {
     using ParentType = ZeroEqProblem<TypeTag>;
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum { dimWorld = GridView::dimensionworld };
-    enum {
-#if NONISOTHERMAL
-        temperatureIdx = Indices::temperatureIdx,
-        energyBalanceIdx = Indices::energyBalanceIdx,
-#endif
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx
-    };
-
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using SourceValues = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-
     using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
 
 public:
@@ -150,9 +134,9 @@ public:
      *
      * \param globalPos The global position
      */
-    SourceValues sourceAtPos(const GlobalPosition &globalPos) const
+    NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
     {
-        return SourceValues(0.0);
+        return NumEqVector(0.0);
     }
     // \}
    /*!
@@ -171,23 +155,25 @@ public:
         BoundaryTypes values;
 
         // set Dirichlet values for the velocity everywhere
-        values.setDirichlet(momentumBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
 #if NONISOTHERMAL
-        values.setDirichlet(energyBalanceIdx);
+        values.setDirichlet(Indices::energyBalanceIdx);
         if (isOutlet(globalPos))
         {
-            values.setOutflow(energyBalanceIdx);
+            values.setOutflow(Indices::energyBalanceIdx);
         }
 #endif
 
         // set a fixed pressure in one cell
         if (isOutlet(globalPos))
         {
-            values.setDirichlet(totalMassBalanceIdx);
-            values.setOutflow(momentumBalanceIdx);
+            values.setDirichlet(Indices::conti0EqIdx);
+            values.setOutflow(Indices::momentumXBalanceIdx);
+            values.setOutflow(Indices::momentumYBalanceIdx);
         }
         else
-            values.setOutflow(totalMassBalanceIdx);
+            values.setOutflow(Indices::conti0EqIdx);
 
         return values;
     }
@@ -204,10 +190,10 @@ public:
 #if NONISOTHERMAL
         if (time() > 10.0)
         {
-            values[temperatureIdx] = inletTemperature_;
+            values[Indices::temperatureIdx] = inletTemperature_;
             if (isOnWall(globalPos))
             {
-                values[temperatureIdx] = wallTemperature_;
+                values[Indices::temperatureIdx] = wallTemperature_;
             }
         }
 #endif
@@ -229,18 +215,18 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values[pressureIdx] = 1.0e+5;
-        values[velocityXIdx] = inletVelocity_;
+        values[Indices::pressureIdx] = 1.0e+5;
+        values[Indices::velocityXIdx] = inletVelocity_;
 #if NONISOTHERMAL
-        values[temperatureIdx] = inletTemperature_;
+        values[Indices::temperatureIdx] = inletTemperature_;
         if (isOnWall(globalPos))
         {
-            values[temperatureIdx] = wallTemperature_;
+            values[Indices::temperatureIdx] = wallTemperature_;
         }
 #endif
         if (isOnWall(globalPos))
         {
-            values[velocityXIdx] = 0.0;
+            values[Indices::velocityXIdx] = 0.0;
         }
 
         return values;
diff --git a/test/freeflow/ransnc/channeltestproblem.hh b/test/freeflow/ransnc/channeltestproblem.hh
index 19511cca260429ff3d9ab16273d4de4fe645b05c..3ad9efdad39df8c6ab409b01ff599c2f78cbfc44 100644
--- a/test/freeflow/ransnc/channeltestproblem.hh
+++ b/test/freeflow/ransnc/channeltestproblem.hh
@@ -52,7 +52,7 @@ SET_TYPE_PROP(ChannelNCTestTypeTag, FluidSystem,
               FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>);
 
 SET_INT_PROP(ChannelNCTestTypeTag, PhaseIdx,
-             GET_PROP_TYPE(TypeTag, FluidSystem)::nPhaseIdx);
+             GET_PROP_TYPE(TypeTag, FluidSystem)::phase1Idx);
 
 SET_INT_PROP(ChannelNCTestTypeTag, ReplaceCompEqIdx, GET_PROP_VALUE(TypeTag, PhaseIdx));
 
@@ -70,7 +70,7 @@ SET_BOOL_PROP(ChannelNCTestTypeTag, EnableGridVolumeVariablesCache, true);
 
 // Enable gravity
 SET_BOOL_PROP(ChannelNCTestTypeTag, UseMoles, true);
-}
+} // end namespace Properties
 
 /*!
  * \ingroup RANSNCTests
@@ -85,39 +85,19 @@ template <class TypeTag>
 class ChannelNCTestProblem : public ZeroEqProblem<TypeTag>
 {
     using ParentType = ZeroEqProblem<TypeTag>;
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum { dimWorld = GridView::dimensionworld };
-    enum {
-        totalMassBalanceIdx = Indices::totalMassBalanceIdx,
-        transportEqIdx = 1-GET_PROP_VALUE(TypeTag, PhaseIdx),
-        momentumBalanceIdx = Indices::momentumBalanceIdx,
-        pressureIdx = Indices::pressureIdx,
-        velocityXIdx = Indices::velocityXIdx,
-        velocityYIdx = Indices::velocityYIdx,
-#if NONISOTHERMAL
-        temperatureIdx = Indices::temperatureIdx,
-        energyBalanceIdx = Indices::energyBalanceIdx,
-#endif
-        transportCompIdx = 1-GET_PROP_VALUE(TypeTag, PhaseIdx)
-    };
 
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
+    static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
-    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-
     using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
-    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
-    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
 
 public:
     ChannelNCTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
@@ -169,47 +149,41 @@ public:
      */
     BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportEqIdx = Indices::conti0EqIdx+1;
         BoundaryTypes values;
 
-        values.setDirichlet(momentumBalanceIdx);
-        values.setOutflow(totalMassBalanceIdx);
+        values.setDirichlet(Indices::momentumXBalanceIdx);
+        values.setDirichlet(Indices::momentumYBalanceIdx);
+        values.setOutflow(Indices::conti0EqIdx);
         values.setOutflow(transportEqIdx);
 #if NONISOTHERMAL
-        values.setOutflow(energyBalanceIdx);
+        values.setOutflow(Indices::energyBalanceIdx);
 #endif
 
-        if(isInlet(globalPos))
+        if(isInlet_(globalPos))
         {
-            values.setDirichlet(momentumBalanceIdx);
-            values.setOutflow(totalMassBalanceIdx);
             values.setDirichlet(transportEqIdx);
+            values.setDirichlet(Indices::conti0EqIdx);
 #if NONISOTHERMAL
-            values.setDirichlet(energyBalanceIdx);
+            values.setDirichlet(Indices::energyBalanceIdx);
 #endif
         }
-        else if(isOutlet(globalPos))
+        else if(isOutlet_(globalPos))
         {
-            values.setOutflow(momentumBalanceIdx);
-            values.setDirichlet(totalMassBalanceIdx);
+            values.setOutflow(Indices::momentumXBalanceIdx);
+            values.setOutflow(Indices::momentumYBalanceIdx);
+            values.setDirichlet(Indices::conti0EqIdx);
             values.setOutflow(transportEqIdx);
 #if NONISOTHERMAL
-            values.setOutflow(energyBalanceIdx);
+            values.setOutflow(Indices::energyBalanceIdx);
 #endif
         }
         else if (isOnWall(globalPos))
         {
-            values.setDirichlet(velocityXIdx);
-            values.setOutflow(velocityYIdx);
-            values.setOutflow(totalMassBalanceIdx);
-            values.setOutflow(transportEqIdx);
 #if NONISOTHERMAL
-            values.setDirichlet(energyBalanceIdx);
+            values.setDirichlet(Indices::energyBalanceIdx);
 #endif
         }
-        else if (isSymmetry(globalPos))
-        {
-            values.isSymmetry();
-        }
 
         return values;
     }
@@ -221,11 +195,12 @@ public:
      */
     PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportCompIdx = Indices::conti0EqIdx+1;
         PrimaryVariables values = initialAtPos(globalPos);
 
         if (time() > 10.0)
         {
-            if (isInlet(globalPos)
+            if (isInlet_(globalPos)
                 && globalPos[1] > 0.4 * this->fvGridGeometry().bBoxMax()[1]
                 && globalPos[1] < 0.6 * this->fvGridGeometry().bBoxMax()[1])
             {
@@ -234,7 +209,7 @@ public:
 #if NONISOTHERMAL
             if (isOnWall(globalPos))
             {
-                values[temperatureIdx] += 30.;
+                values[Indices::temperatureIdx] += 30.;
             }
 #endif
         }
@@ -256,18 +231,19 @@ public:
      */
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
+        static constexpr auto transportCompIdx = Indices::conti0EqIdx+1;
         PrimaryVariables values(0.0);
-        values[pressureIdx] = 1.0e+5;
+        values[Indices::pressureIdx] = 1.0e+5;
         values[transportCompIdx] = 0.0;
 #if NONISOTHERMAL
-        values[temperatureIdx] = temperature();
+        values[Indices::temperatureIdx] = temperature();
 #endif
 
         // block velocity profile
-        values[velocityXIdx] = 0.0;
+        values[Indices::velocityXIdx] = 0.0;
         if (!isOnWall(globalPos))
-            values[velocityXIdx] =  inletVelocity_;
-        values[velocityYIdx] = 0.0;
+            values[Indices::velocityXIdx] =  inletVelocity_;
+        values[Indices::velocityYIdx] = 0.0;
 
         return values;
     }
@@ -289,19 +265,15 @@ public:
         return globalPos[1] < eps_;
     }
 
-    bool isSymmetry(const GlobalPosition& globalPos) const
-    {
-        return globalPos[1] > this->fvGridGeometry().bBoxMax()[0] - eps_;
-    }
-
 private:
 
-    bool isInlet(const GlobalPosition& globalPos) const
+
+    bool isInlet_(const GlobalPosition& globalPos) const
     {
         return globalPos[0] < eps_;
     }
 
-    bool isOutlet(const GlobalPosition& globalPos) const
+    bool isOutlet_(const GlobalPosition& globalPos) const
     {
         return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_;
     }
diff --git a/test/material/fluidsystems/checkfluidsystem.hh b/test/material/fluidsystems/checkfluidsystem.hh
index 2914a7b75e46de3f06189f38d5cdc130bfaecd12..88f1e2e021a2598045136ee25506177754dc5a22 100644
--- a/test/material/fluidsystems/checkfluidsystem.hh
+++ b/test/material/fluidsystems/checkfluidsystem.hh
@@ -136,6 +136,12 @@ public:
         return BaseFluidState::temperature(phaseIdx);
     }
 
+    Scalar wettingPhase() const
+    {
+        assert(allowComposition_);
+        return BaseFluidState::wettingPhase();
+    }
+
     Scalar partialPressure(int phaseIdx, int compIdx) const
     {
         assert(allowComposition_);
diff --git a/test/material/immiscibleflash/test_immiscibleflash.cc b/test/material/immiscibleflash/test_immiscibleflash.cc
index a89a85e7d78c1196ec6201008dd60e97a8ea1c1e..958980b9371a676068f2f0aa6b992d382aa0e150 100644
--- a/test/material/immiscibleflash/test_immiscibleflash.cc
+++ b/test/material/immiscibleflash/test_immiscibleflash.cc
@@ -155,12 +155,12 @@ int main()
 
     enum { numPhases = FluidSystem::numPhases };
     enum { numComponents = FluidSystem::numComponents };
-    enum { wPhaseIdx = FluidSystem::wPhaseIdx };
-    enum { nPhaseIdx = FluidSystem::nPhaseIdx };
+    enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
+    enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
 
     using EffMaterialLaw = Dumux::RegularizedBrooksCorey<Scalar>;
     using TwoPMaterialLaw = Dumux::EffToAbsLaw<EffMaterialLaw>;
-    using MaterialLaw = Dumux::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw>;
+    using MaterialLaw = Dumux::TwoPAdapter<liquidPhaseIdx, TwoPMaterialLaw>;
     using MaterialLawParams = MaterialLaw::Params;
 
     Scalar T = 273.15 + 25;
@@ -196,11 +196,11 @@ int main()
     std::cout << "testing single-phase liquid\n";
 
     // set liquid saturation and pressure
-    fsRef.setSaturation(wPhaseIdx, 1.0);
-    fsRef.setPressure(wPhaseIdx, 1e6);
+    fsRef.setSaturation(liquidPhaseIdx, 1.0);
+    fsRef.setPressure(liquidPhaseIdx, 1e6);
 
     // set the remaining parameters of the reference fluid state
-    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, wPhaseIdx);
+    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, liquidPhaseIdx);
 
     // check the flash calculation
     checkImmiscibleFlash<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams);
@@ -211,11 +211,11 @@ int main()
     std::cout << "testing single-phase gas\n";
 
     // set gas saturation and pressure
-    fsRef.setSaturation(nPhaseIdx, 1.0);
-    fsRef.setPressure(nPhaseIdx, 1e6);
+    fsRef.setSaturation(gasPhaseIdx, 1.0);
+    fsRef.setPressure(gasPhaseIdx, 1e6);
 
     // set the remaining parameters of the reference fluid state
-    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, nPhaseIdx);
+    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, gasPhaseIdx);
 
     // check the flash calculation
     checkImmiscibleFlash<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams);
@@ -226,11 +226,11 @@ int main()
     std::cout << "testing two-phase\n";
 
     // set liquid saturation and pressure
-    fsRef.setSaturation(wPhaseIdx, 0.5);
-    fsRef.setPressure(wPhaseIdx, 1e6);
+    fsRef.setSaturation(liquidPhaseIdx, 0.5);
+    fsRef.setPressure(liquidPhaseIdx, 1e6);
 
     // set the remaining parameters of the reference fluid state
-    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, wPhaseIdx);
+    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, liquidPhaseIdx);
 
     // check the flash calculation
     checkImmiscibleFlash<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams);
@@ -247,13 +247,13 @@ int main()
     matParams2.setLambda(2.0);
 
     // set liquid saturation
-    fsRef.setSaturation(wPhaseIdx, 0.5);
+    fsRef.setSaturation(liquidPhaseIdx, 0.5);
 
     // set pressure of the liquid phase
-    fsRef.setPressure(wPhaseIdx, 1e6);
+    fsRef.setPressure(liquidPhaseIdx, 1e6);
 
     // set the remaining parameters of the reference fluid state
-    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams2, wPhaseIdx);
+    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams2, liquidPhaseIdx);
 
     // check the flash calculation
     checkImmiscibleFlash<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams2);
diff --git a/test/material/ncpflash/test_ncpflash.cc b/test/material/ncpflash/test_ncpflash.cc
index 20dbca2a2425206265296437e4d78739d65620a5..ff562c94ca857c8dd15f247d9bf7bc80a7920076 100644
--- a/test/material/ncpflash/test_ncpflash.cc
+++ b/test/material/ncpflash/test_ncpflash.cc
@@ -157,15 +157,15 @@ int main()
 
     enum { numPhases = FluidSystem::numPhases };
     enum { numComponents = FluidSystem::numComponents };
-    enum { wPhaseIdx = FluidSystem::wPhaseIdx };
-    enum { nPhaseIdx = FluidSystem::nPhaseIdx };
+    enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
+    enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
 
     enum { H2OIdx = FluidSystem::H2OIdx };
     enum { N2Idx = FluidSystem::N2Idx };
 
     using EffMaterialLaw = Dumux::RegularizedBrooksCorey<Scalar>;
     using TwoPMaterialLaw = Dumux::EffToAbsLaw<EffMaterialLaw>;
-    using MaterialLaw = Dumux::TwoPAdapter<wPhaseIdx, TwoPMaterialLaw>;
+    using MaterialLaw = Dumux::TwoPAdapter<liquidPhaseIdx, TwoPMaterialLaw>;
     using MaterialLawParams = MaterialLaw::Params;
 
     Scalar T = 273.15 + 25;
@@ -201,17 +201,17 @@ int main()
     std::cout << "testing single-phase liquid\n";
 
     // set liquid saturation
-    fsRef.setSaturation(wPhaseIdx, 1.0);
+    fsRef.setSaturation(liquidPhaseIdx, 1.0);
 
     // set pressure of the liquid phase
-    fsRef.setPressure(wPhaseIdx, 2e5);
+    fsRef.setPressure(liquidPhaseIdx, 2e5);
 
     // set the liquid composition to pure water
-    fsRef.setMoleFraction(wPhaseIdx, N2Idx, 0.0);
-    fsRef.setMoleFraction(wPhaseIdx, H2OIdx, 1.0);
+    fsRef.setMoleFraction(liquidPhaseIdx, N2Idx, 0.0);
+    fsRef.setMoleFraction(liquidPhaseIdx, H2OIdx, 1.0);
 
     // "complete" the fluid state
-    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, wPhaseIdx);
+    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, liquidPhaseIdx);
 
     // check the flash calculation
     checkNcpFlash<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams);
@@ -221,17 +221,17 @@ int main()
     ////////////////
     std::cout << "testing single-phase gas\n";
     // set gas saturation
-    fsRef.setSaturation(nPhaseIdx, 1.0);
+    fsRef.setSaturation(gasPhaseIdx, 1.0);
 
     // set pressure of the gas phase
-    fsRef.setPressure(nPhaseIdx, 1e6);
+    fsRef.setPressure(gasPhaseIdx, 1e6);
 
     // set the gas composition to 99.9% nitrogen and 0.1% water
-    fsRef.setMoleFraction(nPhaseIdx, N2Idx, 0.999);
-    fsRef.setMoleFraction(nPhaseIdx, H2OIdx, 0.001);
+    fsRef.setMoleFraction(gasPhaseIdx, N2Idx, 0.999);
+    fsRef.setMoleFraction(gasPhaseIdx, H2OIdx, 0.001);
 
     // "complete" the fluid state
-    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, nPhaseIdx);
+    completeReferenceFluidState<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams, gasPhaseIdx);
 
     // check the flash calculation
     checkNcpFlash<Scalar, FluidSystem, MaterialLaw>(fsRef, matParams);
@@ -242,12 +242,12 @@ int main()
     std::cout << "testing two-phase\n";
 
     // set saturations
-    fsRef.setSaturation(wPhaseIdx, 0.5);
-    fsRef.setSaturation(nPhaseIdx, 0.5);
+    fsRef.setSaturation(liquidPhaseIdx, 0.5);
+    fsRef.setSaturation(gasPhaseIdx, 0.5);
 
     // set pressures
-    fsRef.setPressure(wPhaseIdx, 1e6);
-    fsRef.setPressure(nPhaseIdx, 1e6);
+    fsRef.setPressure(liquidPhaseIdx, 1e6);
+    fsRef.setPressure(gasPhaseIdx, 1e6);
 
     FluidSystem::ParameterCache paramCache;
     using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
@@ -269,19 +269,19 @@ int main()
     matParams2.setLambda(2.0);
 
     // set gas saturation
-    fsRef.setSaturation(nPhaseIdx, 0.5);
-    fsRef.setSaturation(wPhaseIdx, 0.5);
+    fsRef.setSaturation(gasPhaseIdx, 0.5);
+    fsRef.setSaturation(liquidPhaseIdx, 0.5);
 
     // set pressure of the liquid phase
-    fsRef.setPressure(wPhaseIdx, 1e6);
+    fsRef.setPressure(liquidPhaseIdx, 1e6);
 
     // calulate the capillary pressure
     using PhaseVector = Dune::FieldVector<Scalar, numPhases>;
     PhaseVector pc;
     MaterialLaw::capillaryPressures(pc, matParams2, fsRef);
-    fsRef.setPressure(nPhaseIdx,
-                      fsRef.pressure(wPhaseIdx)
-                      + (pc[nPhaseIdx] - pc[wPhaseIdx]));
+    fsRef.setPressure(gasPhaseIdx,
+                      fsRef.pressure(liquidPhaseIdx)
+                      + (pc[gasPhaseIdx] - pc[liquidPhaseIdx]));
 
     using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
     MiscibleMultiPhaseComposition::solve(fsRef, paramCache,
diff --git a/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh b/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh
index d4f6eb7bfb964ce93b145415baa94c0782806977..a8e8a3e435308ee75548c2cf7a6a19e17dae4fad 100644
--- a/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh
+++ b/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh
@@ -111,7 +111,7 @@ class OnePNIConductionProblem : public PorousMediumFlowProblem<TypeTag>
     enum { dimWorld = GridView::dimensionworld };
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum {
         // indices of the primary variables
         pressureIdx = Indices::pressureIdx,
diff --git a/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh b/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh
index dba58dc2d6634f04b3dd6aa70fb717a132d8217c..9dcce949d475a0dc3e45dae836e6c94d79f1d6ec 100644
--- a/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh
+++ b/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh
@@ -113,7 +113,7 @@ class OnePNIConvectionProblem : public PorousMediumFlowProblem<TypeTag>
     enum { dimWorld = GridView::dimensionworld };
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum {
         // indices of the primary variables
         pressureIdx = Indices::pressureIdx,
diff --git a/test/porousmediumflow/1p/implicit/1ptestproblem.hh b/test/porousmediumflow/1p/implicit/1ptestproblem.hh
index 46efb421f315bcf12d98d798f188be7aacc513f8..daa94ec6f2a2b1b9b0905008b7f7d9eec3f65252 100644
--- a/test/porousmediumflow/1p/implicit/1ptestproblem.hh
+++ b/test/porousmediumflow/1p/implicit/1ptestproblem.hh
@@ -96,7 +96,7 @@ class OnePTestProblem : public PorousMediumFlowProblem<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum {
         // index of the primary variable
diff --git a/test/porousmediumflow/1p/implicit/fractureproblem.hh b/test/porousmediumflow/1p/implicit/fractureproblem.hh
index cd1dc97476f9b8a56b54637777041eb8684a55f0..50ec649f84bc6fb5f8041b743435cb409d1de343 100644
--- a/test/porousmediumflow/1p/implicit/fractureproblem.hh
+++ b/test/porousmediumflow/1p/implicit/fractureproblem.hh
@@ -81,7 +81,7 @@ class FractureProblem : public PorousMediumFlowProblem<TypeTag>
 {
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum { dimWorld = GridView::dimensionworld };
 
diff --git a/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh b/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh
index c591e27471fafe631975925ddf2bb2f44c49ded6..d7302d7a27971d47ad50898357c543efc6a860ba 100644
--- a/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh
+++ b/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh
@@ -84,7 +84,7 @@ class OnePSingularityProblem : public PorousMediumFlowProblem<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum { dimWorld = GridView::dimensionworld };
     enum {
         // index of the primary variable
diff --git a/test/porousmediumflow/1p/implicit/tubesproblem.hh b/test/porousmediumflow/1p/implicit/tubesproblem.hh
index c9f7de4b49707c50b4792344514aa20ce3a1a1b2..f864b99e6de97a5a32c29fb331f47ef7b1ab79ad 100644
--- a/test/porousmediumflow/1p/implicit/tubesproblem.hh
+++ b/test/porousmediumflow/1p/implicit/tubesproblem.hh
@@ -84,7 +84,7 @@ class TubesTestProblem : public PorousMediumFlowProblem<TypeTag>
     static const int dim = GridView::dimension;
     static const int dimWorld = GridView::dimensionworld;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum {
         // indices of the primary variables
         conti0EqIdx = Indices::conti0EqIdx,
diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh
index 231ba182d3619c9cdf522edfeb6c5b38cf69da80..d2888abc3ba7ac69101ceb721a7effbc0a48f664 100644
--- a/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh
+++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh
@@ -116,7 +116,7 @@ class TestDiffusionProblem: public DiffusionProblem2P<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Grid = typename GridView::Grid;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using WettingPhase = typename GET_PROP(TypeTag, FluidSystem)::WettingPhase;
 
diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh
index b9792630726199a0d526c8c5619571aa90d63f1c..4090049d7d646da7f875686e8d5642b1ef66e9c8 100644
--- a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh
+++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh
@@ -100,7 +100,7 @@ class TestDiffusion3DProblem: public DiffusionProblem2P<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Grid = typename GridView::Grid;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh
index cc9e1d55423332a0febea4413b8e47c0681ba577..83254389da858022cac5ba27d7f2a4b33382003a 100644
--- a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh
+++ b/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh
@@ -102,7 +102,7 @@ class OnePTwoCNIConductionProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
@@ -120,14 +120,11 @@ class OnePTwoCNIConductionProblem : public PorousMediumFlowProblem<TypeTag>
     {
         // indices of the primary variables
         pressureIdx = Indices::pressureIdx,
-        massOrMoleFracIdx = Indices::firstMoleFracIdx,
         temperatureIdx = Indices::temperatureIdx,
     };
 
     //! property that defines whether mole or mass fractions are used
     static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-    static const auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
-
     static const int dimWorld = GridView::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
@@ -169,7 +166,7 @@ public:
         volVars.update(someElemSol, *this, someElement, someScv);
 
         const auto porosity = this->spatialParams().porosity(someElement, someScv, someElemSol);
-        const auto densityW = volVars.density(phaseIdx);
+        const auto densityW = volVars.density();
         const auto heatCapacityW = IapwsH2O::liquidHeatCapacity(someInitSol[temperatureIdx], someInitSol[pressureIdx]);
         const auto densityS = this->spatialParams().solidDensity(someElement, someScv, someElemSol);
         const auto heatCapacityS = this->spatialParams().solidHeatCapacity(someElement, someScv, someElemSol);
@@ -302,7 +299,7 @@ private:
     {
         PrimaryVariables priVars;
         priVars[pressureIdx] = 1e5; // initial condition for the pressure
-        priVars[massOrMoleFracIdx] = 1e-5;  // initial condition for the N2 molefraction
+        priVars[FluidSystem::N2Idx] = 1e-5;  // initial condition for the N2 molefraction
         priVars[temperatureIdx] = 290.;
         return priVars;
     }
diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh
index 4b18fdede109e167ee8da5b5aa018e1cdb8a7c8f..6f4c76918ff23447276a267eb52089c059d45d06 100644
--- a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh
+++ b/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh
@@ -102,7 +102,7 @@ class OnePTwoCNIConvectionProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
@@ -122,14 +122,16 @@ class OnePTwoCNIConvectionProblem : public PorousMediumFlowProblem<TypeTag>
     {
         // indices of the primary variables
         pressureIdx = Indices::pressureIdx,
-        massOrMoleFracIdx = Indices::firstMoleFracIdx,
         temperatureIdx = Indices::temperatureIdx,
+
+        // equation indices
+        contiH2OIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
+        contiN2Idx = Indices::conti0EqIdx + FluidSystem::N2Idx,
+        energyEqIdx = Indices::energyEqIdx
     };
 
     //! property that defines whether mole or mass fractions are used
     static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-    static const auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
-
     static const int dimWorld = GridView::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
@@ -178,7 +180,7 @@ public:
         volVars.update(someElemSol, *this, someElement, someScv);
 
         const auto porosity = this->spatialParams().porosity(someElement, someScv, someElemSol);
-        const auto densityW = volVars.density(phaseIdx);
+        const auto densityW = volVars.density();
         const auto heatCapacityW = IapwsH2O::liquidHeatCapacity(someInitSol[temperatureIdx], someInitSol[pressureIdx]);
         const auto storageW =  densityW*heatCapacityW*porosity;
         const auto densityS = this->spatialParams().solidDensity(someElement, someScv, someElemSol);
@@ -288,10 +290,11 @@ public:
 
         if(globalPos[0] < eps_)
         {
-             flux[pressureIdx] = -darcyVelocity_*elemVolVars[scv].molarDensity(phaseIdx);
-             flux[massOrMoleFracIdx] = -darcyVelocity_*elemVolVars[scv].molarDensity(phaseIdx)*elemVolVars[scv].moleFraction(phaseIdx, massOrMoleFracIdx);
-             flux[temperatureIdx] = -darcyVelocity_*elemVolVars[scv].density(phaseIdx)
-                                      *IapwsH2O::liquidEnthalpy(temperatureHigh_, elemVolVars[scv].pressure(phaseIdx));
+             flux[contiH2OIdx] = -darcyVelocity_*elemVolVars[scv].molarDensity();
+             flux[contiN2Idx] = -darcyVelocity_*elemVolVars[scv].molarDensity()*elemVolVars[scv].moleFraction(0, FluidSystem::N2Idx);
+             flux[energyEqIdx] = -darcyVelocity_
+                                 *elemVolVars[scv].density()
+                                 *IapwsH2O::liquidEnthalpy(temperatureHigh_, elemVolVars[scv].pressure());
         }
 
         return flux;
@@ -337,7 +340,7 @@ private:
     {
         PrimaryVariables priVars;
         priVars[pressureIdx] = pressureLow_; // initial condition for the pressure
-        priVars[massOrMoleFracIdx] = 1e-10;  // initial condition for the N2 molefraction
+        priVars[FluidSystem::N2Idx] = 1e-10;  // initial condition for the N2 molefraction
         priVars[temperatureIdx] = temperatureLow_;
         return priVars;
     }
diff --git a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh
index 175c0a628a0fd737f9ed5012f8148f9408fc62d5..addb94784e82ec2ce444228f63c26dbe013ad079 100644
--- a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh
+++ b/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh
@@ -102,7 +102,7 @@ class OnePTwoCTestProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
@@ -119,16 +119,14 @@ class OnePTwoCTestProblem : public PorousMediumFlowProblem<TypeTag>
     {
         // indices of the primary variables
         pressureIdx = Indices::pressureIdx,
-        massOrMoleFracIdx = Indices::firstMoleFracIdx,
 
         // indices of the equations
-        conti0EqIdx = Indices::conti0EqIdx,
-        transportEqIdx = Indices::firstTransportEqIdx
+        contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
+        contiN2EqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx
     };
 
     //! property that defines whether mole or mass fractions are used
     static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
-    static const auto phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx);
     static const bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box;
 
     static const int dimWorld = GridView::dimensionworld;
@@ -199,7 +197,7 @@ public:
         // condition for the N2 molefraction at left boundary
         if (globalPos[0] < eps_ )
         {
-            values[massOrMoleFracIdx] = 2.0e-5;
+            values[FluidSystem::N2Idx] = 2.0e-5;
         }
 
         return values;
@@ -244,9 +242,9 @@ public:
         // otherwise compute the acutal fluxes explicitly
         if(isBox && useNitscheTypeBc_)
         {
-            flux[conti0EqIdx] = (volVars.pressure(phaseIdx) - dirichletPressure) * 1e7;
-            flux[transportEqIdx] = flux[conti0EqIdx]  * (useMoles ? volVars.moleFraction(phaseIdx, massOrMoleFracIdx) :
-                                                                    volVars.massFraction(phaseIdx, massOrMoleFracIdx));
+            flux[contiH2OEqIdx] = (volVars.pressure() - dirichletPressure) * 1e7;
+            flux[contiN2EqIdx] = flux[contiH2OEqIdx]  * (useMoles ? volVars.moleFraction(0, FluidSystem::N2Idx) :
+                                                                    volVars.massFraction(0, FluidSystem::N2Idx));
             return flux;
         }
 
@@ -284,16 +282,16 @@ public:
         }();
 
         const Scalar K = volVars.permeability();
-        const Scalar density = useMoles ? volVars.molarDensity(phaseIdx) : volVars.density(phaseIdx);
+        const Scalar density = useMoles ? volVars.molarDensity() : volVars.density();
 
         // calculate the flux
         Scalar tpfaFlux = gradient * scvf.unitOuterNormal();
         tpfaFlux *= -1.0  * K;
-        tpfaFlux *=  density * volVars.mobility(phaseIdx);
-        flux[conti0EqIdx] = tpfaFlux;
+        tpfaFlux *=  density * volVars.mobility();
+        flux[contiH2OEqIdx] = tpfaFlux;
 
         // emulate an outflow condition for the component transport on the right side
-        flux[transportEqIdx] = tpfaFlux  * (useMoles ? volVars.moleFraction(phaseIdx, massOrMoleFracIdx) : volVars.massFraction(phaseIdx, massOrMoleFracIdx));
+        flux[contiN2EqIdx] = tpfaFlux  * (useMoles ? volVars.moleFraction(0, FluidSystem::N2Idx) : volVars.massFraction(0, FluidSystem::N2Idx));
 
         return flux;
     }
@@ -338,7 +336,7 @@ private:
     {
         PrimaryVariables priVars;
         priVars[pressureIdx] = 2e5 - 1e5*globalPos[0]; // initial condition for the pressure
-        priVars[massOrMoleFracIdx] = 0.0;  // initial condition for the N2 molefraction
+        priVars[FluidSystem::N2Idx] = 0.0;  // initial condition for the N2 molefraction
         return priVars;
     }
         static constexpr Scalar eps_ = 1e-6;
diff --git a/test/porousmediumflow/1pncmin/implicit/modifiedsteamn2cao2h2.hh b/test/porousmediumflow/1pncmin/implicit/modifiedsteamn2cao2h2.hh
index 9a35ef1d847f816a905965478dee78bd3438525a..1753dd0c0e9fa5b1d545e783acf18846bfa36e6a 100644
--- a/test/porousmediumflow/1pncmin/implicit/modifiedsteamn2cao2h2.hh
+++ b/test/porousmediumflow/1pncmin/implicit/modifiedsteamn2cao2h2.hh
@@ -42,10 +42,9 @@
 // we use a modified implementation of the CaO component
 #include "modifiedcao.hh"
 
-namespace Dumux
-{
-namespace FluidSystems
-{
+namespace Dumux {
+namespace FluidSystems {
+
 /*!
  * \ingroup OnePNCMinTests
  *
@@ -80,20 +79,27 @@ public:
     // the type of parameter cache objects. this fluid system does not
     using ParameterCache = Dumux::NullParameterCache;
 
-    /****************************************
-     * Fluid phase related static parameters
-     ****************************************/
-
     //! Number of phases in the fluid system
     static constexpr int numPhases = 1; //gas phase: N2 and steam
-    static const int numSPhases = 2;//  solid phases CaO and CaO2H2
-
-    static constexpr int gPhaseIdx = 0;
-    static const int nPhaseIdx = gPhaseIdx; // index of the gas phase
-
-    static constexpr int cPhaseIdx = 1; // CaO-phaseIdx
-    static constexpr int hPhaseIdx = 2; // CaO2H2-phaseIdx
+    static constexpr int numComponents = 2; // H2O, Air
+    static constexpr int numSPhases = 2;//  solid phases CaO and CaO2H2 TODO: Remove
+    static constexpr int numSComponents = 2;// CaO2H2, CaO TODO: Remove
+
+    static constexpr int gasPhaseIdx = 0;  //!< index of the gas phase
+    static constexpr int phase0Idx = gasPhaseIdx; //!< index of the only phase
+    static constexpr int cPhaseIdx = 1; // CaO-phaseIdx TODO: Remove
+    static constexpr int hPhaseIdx = 2; // CaO2H2-phaseIdx TODO: Remove
+
+    static constexpr int N2Idx = 0;
+    static constexpr int H2OIdx = 1;
+    static constexpr int comp0Idx = N2Idx;
+    static constexpr int comp1Idx = H2OIdx;
+    static constexpr int CaOIdx  = 2; // CaO-phaseIdx TODO: Remove
+    static constexpr int CaO2H2Idx  = 3; // CaO-phaseIdx TODO: Remove
 
+    /****************************************
+     * Fluid phase related static parameters
+     ****************************************/
 
     /*!
      * \brief Return the human readable name of a fluid phase
@@ -103,7 +109,7 @@ public:
     static std::string phaseName(int phaseIdx)
     {
         switch (phaseIdx) {
-        case nPhaseIdx: return "gas";
+        case gasPhaseIdx: return "gas";
         case cPhaseIdx : return "CaO";
         case hPhaseIdx : return "CaOH2";
         }
@@ -118,7 +124,7 @@ public:
     static bool isGas (int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        return phaseIdx == nPhaseIdx;
+        return phaseIdx == gasPhaseIdx;
     }
 
     /*!
@@ -176,18 +182,6 @@ public:
     /****************************************
     * Component related static parameters
     ****************************************/
-
-    static const int numComponents = 2; // H2O, Air
-    static const int numMajorComponents = 2;// H2O, Air
-    static const int numSComponents = 2;// CaO2H2, CaO
-
-
-    static const int N2Idx = 0;
-    static const int H2OIdx = 1;
-    static const int CaOIdx  = 2;
-    static const int CaO2H2Idx  = 3;
-
-
     /*!
      * \brief Return the human readable name of a component
      *
@@ -352,13 +346,13 @@ public:
             // for the gas phase assume an ideal gas
             return
                 IdealGas::molarDensity(T, p)
-                * fluidState.averageMolarMass(nPhaseIdx)
+                * fluidState.averageMolarMass(gasPhaseIdx)
                 / std::max(1e-5, sumMoleFrac);
         else
         {
             return
-                (H2O::gasDensity(T, fluidState.partialPressure(nPhaseIdx, H2OIdx)) +
-                N2::gasDensity(T, fluidState.partialPressure(nPhaseIdx, N2Idx)));
+                (H2O::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx)) +
+                N2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx)));
         }
       }
 
@@ -437,7 +431,7 @@ public:
         Scalar temperature = fluidState.temperature(phaseIdx);
         Scalar pressure = fluidState.pressure(phaseIdx);
 
-        assert(phaseIdx == gPhaseIdx);
+        assert(phaseIdx == gasPhaseIdx);
 
         if (compIIdx != N2Idx)
             std::swap(compIIdx, compJIdx);
@@ -473,13 +467,13 @@ public:
     static Scalar enthalpy(const FluidState &fluidState,
                            int phaseIdx)
     {
-        assert(phaseIdx == gPhaseIdx);
+        assert(phaseIdx == gasPhaseIdx);
 
         Scalar T = fluidState.temperature(phaseIdx);
         Scalar p = fluidState.pressure(phaseIdx);
 
-        Scalar XN2 = fluidState.massFraction(gPhaseIdx, N2Idx);
-        Scalar XH2O = fluidState.massFraction(gPhaseIdx, H2OIdx);
+        Scalar XN2 = fluidState.massFraction(gasPhaseIdx, N2Idx);
+        Scalar XH2O = fluidState.massFraction(gasPhaseIdx, H2OIdx);
 
         Scalar result = 0;
         result += XH2O * H2O::gasEnthalpy(T, p);
@@ -500,8 +494,8 @@ public:
                                     int phaseIdx,
                                     int componentIdx)
     {
-        Scalar T = fluidState.temperature(nPhaseIdx);
-        Scalar p = fluidState.pressure(nPhaseIdx);
+        Scalar T = fluidState.temperature(gasPhaseIdx);
+        Scalar p = fluidState.pressure(gasPhaseIdx);
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
 
@@ -522,7 +516,7 @@ public:
                                     int componentIdx)
     {
         Scalar T = 573.15;
-        Scalar p = fluidState.pressure(nPhaseIdx);
+        Scalar p = fluidState.pressure(gasPhaseIdx);
         Valgrind::CheckDefined(T);
         Valgrind::CheckDefined(p);
 
@@ -606,7 +600,7 @@ public:
                                     fluidState.pressure(phaseIdx)
                                     * fluidState.moleFraction(phaseIdx, H2OIdx));
 
-        return c_pH2O*fluidState.moleFraction(nPhaseIdx, H2OIdx) + c_pN2*fluidState.moleFraction(nPhaseIdx, N2Idx);
+        return c_pH2O*fluidState.moleFraction(gasPhaseIdx, H2OIdx) + c_pN2*fluidState.moleFraction(gasPhaseIdx, N2Idx);
     }
 
 };
diff --git a/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh b/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh
index 5e669a82b889478aadd5f600195196a3429d265e..dda4373600c342e74d67b0f8e52c7e0cc5c6194b 100644
--- a/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh
+++ b/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh
@@ -89,7 +89,7 @@ class ThermoChemProblem : public PorousMediumFlowProblem<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
@@ -100,7 +100,7 @@ class ThermoChemProblem : public PorousMediumFlowProblem<TypeTag>
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
-    using ReactionRate =ThermoChemReaction<TypeTag>;
+    using ReactionRate = ThermoChemReaction;
 
     enum { dim = GridView::dimension };
     enum { dimWorld = GridView::dimensionworld };
@@ -109,7 +109,7 @@ class ThermoChemProblem : public PorousMediumFlowProblem<TypeTag>
     {
         // Indices of the primary variables
         pressureIdx = Indices::pressureIdx, //gas-phase pressure
-        firstMoleFracIdx = Indices::firstMoleFracIdx, // mole fraction water
+        H2OIdx = FluidSystem::H2OIdx, // mole fraction water
 
         CaOIdx = FluidSystem::numComponents,
         CaO2H2Idx = FluidSystem::numComponents+1,
@@ -180,7 +180,7 @@ public:
 
         // we don't set any BCs for the solid phases
         values.setDirichlet(pressureIdx);
-        values.setDirichlet(firstMoleFracIdx);
+        values.setDirichlet(H2OIdx);
         values.setDirichlet(temperatureIdx);
 
         return values;
@@ -197,7 +197,7 @@ public:
         PrimaryVariables priVars(0.0);
 
         priVars[pressureIdx] = boundaryPressure_;
-        priVars[firstMoleFracIdx] = boundaryVaporMoleFrac_;
+        priVars[H2OIdx] = boundaryVaporMoleFrac_;
         priVars[temperatureIdx] = boundaryTemperature_;
         priVars[CaO2H2Idx] = 0.0;
         priVars[CaOIdx] = 0.2;
@@ -250,7 +250,7 @@ public:
         CaO2H2Init = getParam<Scalar>("Problem.CaO2H2Initial");
 
         priVars[pressureIdx] = pInit;
-        priVars[firstMoleFracIdx]   = h2oInit;
+        priVars[H2OIdx]   = h2oInit;
         priVars[temperatureIdx] = tInit;
 
         // these values are not used, as we didn't set BCs
@@ -292,7 +292,7 @@ public:
         Scalar qMass = rrate_.thermoChemReaction(volVars);
 
         const auto elemSol = elementSolution(element, elemVolVars, fvGeometry);
-        Scalar qMole = qMass/FluidSystem::molarMass(firstMoleFracIdx)*(1-this->spatialParams().porosity(element, scv, elemSol));
+        Scalar qMole = qMass/FluidSystem::molarMass(H2OIdx)*(1-this->spatialParams().porosity(element, scv, elemSol));
 
         // make sure not more solid reacts than present
         // In this test, we only consider discharge. Therefore, we use the cPhaseIdx for CaO.
@@ -303,7 +303,7 @@ public:
 
         source[conti0EqIdx+CaO2H2Idx] = qMole;
         source[conti0EqIdx+CaOIdx] = - qMole;
-        source[conti0EqIdx+firstMoleFracIdx] = - qMole;
+        source[conti0EqIdx+H2OIdx] = - qMole;
 
         Scalar deltaH = 108e3; // J/mol
         source[energyEqIdx] = qMole * deltaH;
diff --git a/test/porousmediumflow/1pncmin/implicit/thermochemreaction.hh b/test/porousmediumflow/1pncmin/implicit/thermochemreaction.hh
index bc96dfb653763b6764630df51872fbfd77aad6a9..2881de870d9dac35183f0ead7da08994b5a78e78 100644
--- a/test/porousmediumflow/1pncmin/implicit/thermochemreaction.hh
+++ b/test/porousmediumflow/1pncmin/implicit/thermochemreaction.hh
@@ -26,11 +26,7 @@
 #ifndef DUMUX_THERMOCHEM_REACTION_HH
 #define DUMUX_THERMOCHEM_REACTION_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
-
+namespace Dumux {
 
 /*!
  * \ingroup OnePNCMinTests
@@ -38,67 +34,50 @@ namespace Dumux
  *
  * It contains simple and advanced reaction kinetics according to Nagel et al. (2014).
  */
-template<class TypeTag>
 class ThermoChemReaction
 {
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-
-    static const int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents();
-    static const int numSolidPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numSPhases();
-
-    enum{
-        // Indices of the primary variables
-        pressureIdx = Indices::pressureIdx, //gas-phase pressure
-        firstMoleFracIdx = Indices::firstMoleFracIdx, // mole fraction water
-
-        // Phase Indices
-        phaseIdx = FluidSystem::gPhaseIdx,
-        cPhaseIdx = FluidSystem::cPhaseIdx,
-        hPhaseIdx = FluidSystem::hPhaseIdx
-    };
-
 public:
-
-
     /*!
      * \brief evaluates the reaction kinetics (see Nagel et al. 2014)
      */
-    Scalar thermoChemReaction(const VolumeVariables &volVars) const
+    template<class VolumeVariables>
+    typename VolumeVariables::PrimaryVariables::value_type
+    thermoChemReaction(const VolumeVariables &volVars) const
     {
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
+
         // calculate the equilibrium temperature Teq
         Scalar T= volVars.temperature();
         Scalar Teq = 0;
 
         Scalar moleFractionVapor = 1e-3;
 
-        if(volVars.moleFraction(phaseIdx, firstMoleFracIdx) > 1e-3)
-            moleFractionVapor = volVars.moleFraction(phaseIdx, firstMoleFracIdx);
+        if(volVars.moleFraction(FluidSystem::gasPhaseIdx, FluidSystem::H2OIdx) > 1e-3)
+            moleFractionVapor = volVars.moleFraction(FluidSystem::gasPhaseIdx, FluidSystem::H2OIdx);
 
-        if(volVars.moleFraction(phaseIdx, firstMoleFracIdx) >= 1.0) moleFractionVapor = 1;
+        if(volVars.moleFraction(FluidSystem::gasPhaseIdx, FluidSystem::H2OIdx) >= 1.0) moleFractionVapor = 1;
 
-        Scalar pV = volVars.pressure(phaseIdx) *moleFractionVapor;
+        Scalar pV = volVars.pressure(FluidSystem::gasPhaseIdx) *moleFractionVapor;
         Scalar vaporPressure = pV*1.0e-5;
         Scalar pFactor = log(vaporPressure);
 
         Teq = -12845;
         Teq /= (pFactor - 16.508); //the equilibrium temperature
 
-        Scalar realSolidDensityAverage = (volVars.precipitateVolumeFraction(hPhaseIdx)*volVars.density(hPhaseIdx)
-                                        + volVars.precipitateVolumeFraction(cPhaseIdx)*volVars.density(cPhaseIdx))
-                                        / (volVars.precipitateVolumeFraction(hPhaseIdx)
-                                        + volVars.precipitateVolumeFraction(cPhaseIdx));
+        Scalar realSolidDensityAverage = (volVars.precipitateVolumeFraction(FluidSystem::hPhaseIdx)*volVars.density(FluidSystem::hPhaseIdx)
+                                        + volVars.precipitateVolumeFraction(FluidSystem::cPhaseIdx)*volVars.density(FluidSystem::cPhaseIdx))
+                                        / (volVars.precipitateVolumeFraction(FluidSystem::hPhaseIdx)
+                                        + volVars.precipitateVolumeFraction(FluidSystem::cPhaseIdx));
 
-        if(realSolidDensityAverage <= volVars.density(cPhaseIdx))
+        if(realSolidDensityAverage <= volVars.density(FluidSystem::cPhaseIdx))
         {
-            realSolidDensityAverage = volVars.density(cPhaseIdx);
+            realSolidDensityAverage = volVars.density(FluidSystem::cPhaseIdx);
         }
 
-        if(realSolidDensityAverage >= volVars.density(hPhaseIdx))
+        if(realSolidDensityAverage >= volVars.density(FluidSystem::hPhaseIdx))
         {
-            realSolidDensityAverage = volVars.density(hPhaseIdx);
+            realSolidDensityAverage = volVars.density(FluidSystem::hPhaseIdx);
         }
 
         Scalar qMass = 0.0;
@@ -108,7 +87,7 @@ public:
             Scalar dXH_dt1 = 0.0;
             Scalar dXH_dt2 = 0.0;
 
-            Scalar xH = (realSolidDensityAverage-volVars.density(cPhaseIdx))/(volVars.density(hPhaseIdx)- volVars.density(cPhaseIdx));
+            Scalar xH = (realSolidDensityAverage-volVars.density(FluidSystem::cPhaseIdx))/(volVars.density(FluidSystem::hPhaseIdx)- volVars.density(FluidSystem::cPhaseIdx));
 
             if(xH < 1.0e-5) {xH = 1.0e-5; }
             if(xH >=1 ) {xH = 1 - 1e-5; }
@@ -164,7 +143,7 @@ public:
             // no reaction at equilibrium
             if(Teq -T <= 0)
                 dXH_dt = 0;
-            Scalar deltaRhoS = volVars.density(hPhaseIdx) - volVars.density(cPhaseIdx);
+            Scalar deltaRhoS = volVars.density(FluidSystem::hPhaseIdx) - volVars.density(FluidSystem::cPhaseIdx);
             qMass = dXH_dt*deltaRhoS;
         }
 
@@ -175,49 +154,54 @@ public:
     /*!
      * \brief evaluates the simple chemical reaction kinetics (see Nagel et al. 2014)
      */
-    Scalar thermoChemReactionSimple(const VolumeVariables &volVars) const
+    template<class VolumeVariables>
+    typename VolumeVariables::PrimaryVariables::value_type
+    thermoChemReactionSimple(const VolumeVariables &volVars) const
     {
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+        using Scalar = typename VolumeVariables::PrimaryVariables::value_type;
+
         // calculate the equilibrium temperature Teq
         Scalar T= volVars.temperature();
         Scalar Teq = 0;
 
         Scalar moleFractionVapor = 1e-3;
 
-        if(volVars.moleFraction(phaseIdx, firstMoleFracIdx) > 1e-3)
-            moleFractionVapor = volVars.moleFraction(phaseIdx, firstMoleFracIdx);
+        if(volVars.moleFraction(FluidSystem::gasPhaseIdx, FluidSystem::H2OIdx) > 1e-3)
+            moleFractionVapor = volVars.moleFraction(FluidSystem::gasPhaseIdx, FluidSystem::H2OIdx);
 
-        if(volVars.moleFraction(phaseIdx, firstMoleFracIdx) >= 1.0) moleFractionVapor = 1;
+        if(volVars.moleFraction(FluidSystem::gasPhaseIdx, FluidSystem::H2OIdx) >= 1.0) moleFractionVapor = 1;
 
-        Scalar pV = volVars.pressure(phaseIdx) *moleFractionVapor;
+        Scalar pV = volVars.pressure(FluidSystem::gasPhaseIdx) *moleFractionVapor;
         Scalar vaporPressure = pV*1.0e-5;
         Scalar pFactor = log(vaporPressure);
 
         Teq = -12845;
         Teq /= (pFactor - 16.508); //the equilibrium temperature
 
-        Scalar realSolidDensityAverage = (volVars.precipitateVolumeFraction(hPhaseIdx)*volVars.density(hPhaseIdx)
-                                        + volVars.precipitateVolumeFraction(cPhaseIdx)*volVars.density(cPhaseIdx))
-                                        / (volVars.precipitateVolumeFraction(hPhaseIdx)
-                                        + volVars.precipitateVolumeFraction(cPhaseIdx));
+        Scalar realSolidDensityAverage = (volVars.precipitateVolumeFraction(FluidSystem::hPhaseIdx)*volVars.density(FluidSystem::hPhaseIdx)
+                                        + volVars.precipitateVolumeFraction(FluidSystem::cPhaseIdx)*volVars.density(FluidSystem::cPhaseIdx))
+                                        / (volVars.precipitateVolumeFraction(FluidSystem::hPhaseIdx)
+                                        + volVars.precipitateVolumeFraction(FluidSystem::cPhaseIdx));
 
-        if(realSolidDensityAverage <= volVars.density(cPhaseIdx))
+        if(realSolidDensityAverage <= volVars.density(FluidSystem::cPhaseIdx))
         {
-            realSolidDensityAverage = volVars.density(cPhaseIdx);
+            realSolidDensityAverage = volVars.density(FluidSystem::cPhaseIdx);
         }
 
-        if(realSolidDensityAverage >= volVars.density(hPhaseIdx))
+        if(realSolidDensityAverage >= volVars.density(FluidSystem::hPhaseIdx))
         {
-            realSolidDensityAverage = volVars.density(hPhaseIdx);
+            realSolidDensityAverage = volVars.density(FluidSystem::hPhaseIdx);
         }
 
         Scalar qMass = 0.0;
 
          //discharge or hydration
         if (T < Teq){
-            Scalar massFracH2O_fPhase = volVars.massFraction(phaseIdx, firstMoleFracIdx);
+            Scalar massFracH2O_fPhase = volVars.massFraction(FluidSystem::gasPhaseIdx, FluidSystem::H2OIdx);
             Scalar krh = 0.2;
 
-            Scalar rHydration = - massFracH2O_fPhase* (volVars.density(hPhaseIdx)- realSolidDensityAverage)
+            Scalar rHydration = - massFracH2O_fPhase* (volVars.density(FluidSystem::hPhaseIdx)- realSolidDensityAverage)
                                                      * krh * (T-Teq)/ Teq;
 
             Scalar qMass =  rHydration;
@@ -228,7 +212,7 @@ public:
 
             Scalar krd = 0.05;
 
-            Scalar rDehydration = -(volVars.density(cPhaseIdx)- realSolidDensityAverage)
+            Scalar rDehydration = -(volVars.density(FluidSystem::cPhaseIdx)- realSolidDensityAverage)
                                                      * krd * (Teq-T)/ Teq;
 
             qMass =  rDehydration;
diff --git a/test/porousmediumflow/2p/implicit/fracture/problem.hh b/test/porousmediumflow/2p/implicit/fracture/problem.hh
index 838b41ef3eb82591ea0dfd5e0857ae0328dbcf13..4d9f46f896d75212166f7d400edab002518ee220 100644
--- a/test/porousmediumflow/2p/implicit/fracture/problem.hh
+++ b/test/porousmediumflow/2p/implicit/fracture/problem.hh
@@ -74,7 +74,7 @@ SET_BOOL_PROP(FractureTypeTag, EnableGridFluxVariablesCache, true);
 
 // permeablility is solution-independent
 SET_BOOL_PROP(FractureTypeTag, SolutionDependentAdvection, false);
-}
+} // end namespace Properties
 
 /*!
  * \ingroup TwoPTests
@@ -86,20 +86,21 @@ class FractureProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
 
-    enum {
-
+    enum
+    {
         // primary variable indices
-        pwIdx = Indices::pwIdx,
-        snIdx = Indices::snIdx,
+        pressureIdx = Indices::pressureIdx,
+        saturationIdx = Indices::saturationIdx,
 
         // equation indices
-        contiNEqIdx = Indices::contiNEqIdx,
+        contiTCEEqIdx = Indices::conti0EqIdx + FluidSystem::comp1Idx,
 
         // world dimension
         dimWorld = GridView::dimensionworld
@@ -193,8 +194,8 @@ public:
         const auto g = this->gravityAtPos(globalPos)[dimWorld-1];
 
         PrimaryVariables values;
-        values[pwIdx] = 1e5 + 1000*g*depth;
-        values[snIdx] = 0.0;
+        values[pressureIdx] = 1e5 + 1000*g*depth;
+        values[saturationIdx] = 0.0;
         return values;
     }
 
@@ -213,7 +214,7 @@ public:
     {
         NumEqVector values(0.0);
         if (onInlet_(globalPos)) {
-            values[contiNEqIdx] = -0.04; // kg / (m * s)
+            values[contiTCEEqIdx] = -0.04; // kg / (m * s)
         }
         return values;
     }
diff --git a/test/porousmediumflow/2p/implicit/fracture/spatialparams.hh b/test/porousmediumflow/2p/implicit/fracture/spatialparams.hh
index 9a98055ae09d23da6645f61290629dee308fbb0e..b562d853be036fdcfa51dbcbba9bb8d2fd3607bd 100644
--- a/test/porousmediumflow/2p/implicit/fracture/spatialparams.hh
+++ b/test/porousmediumflow/2p/implicit/fracture/spatialparams.hh
@@ -77,16 +77,14 @@ class FractureSpatialParams : public FVSpatialParams<TypeTag>
 
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
-    //get the material law from the property system
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
-
 public:
-    // export permeability type
+    //! export permeability type
     using PermeabilityType = Scalar;
+    //! export the type used for the material law
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
 
-     FractureSpatialParams(const Problem& problem)
-     : ParentType(problem)
+    FractureSpatialParams(const Problem& problem): ParentType(problem)
     {
         // residual saturations
         materialParams_.setSwr(0.05);
@@ -104,9 +102,7 @@ public:
      * \param globalPos The global position
      */
     Scalar permeabilityAtPos(const GlobalPosition& globalPos) const
-    {
-        return 1e-10;
-    }
+    { return 1e-10; }
 
     /*!
      * \brief Returns the porosity \f$[-]\f$
@@ -122,10 +118,17 @@ public:
      * \param globalPos The position at which we evaluate
      */
     const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
-    {
-        return materialParams_;
-    }
+    { return materialParams_; }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The global position
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::phase0Idx; }
 
 private:
     MaterialLawParams materialParams_;
diff --git a/test/porousmediumflow/2p/implicit/incompressible/problem.hh b/test/porousmediumflow/2p/implicit/incompressible/problem.hh
index 7701c69e79fb27b55c21b241bb05d436cb040b8e..26e44a4e4db8bc22b6e655d7bffab1b417e1eab6 100644
--- a/test/porousmediumflow/2p/implicit/incompressible/problem.hh
+++ b/test/porousmediumflow/2p/implicit/incompressible/problem.hh
@@ -91,11 +91,13 @@ class TwoPTestProblem : public PorousMediumFlowProblem<TypeTag>
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>;
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum {
-        pwIdx = Indices::pwIdx,
-        snIdx = Indices::snIdx,
-        contiNEqIdx = Indices::contiNEqIdx
+        pressureH2OIdx = Indices::pressureIdx,
+        saturationDNAPLIdx = Indices::saturationIdx,
+        contiDNAPLEqIdx = Indices::conti0EqIdx + FluidSystem::comp1Idx,
+        waterPhaseIdx = FluidSystem::phase0Idx,
+        dnaplPhaseIdx = FluidSystem::phase1Idx
     };
 
 public:
@@ -132,10 +134,10 @@ public:
         PrimaryVariables values;
         typename GET_PROP_TYPE(TypeTag, FluidState) fluidState;
         fluidState.setTemperature(temperature());
-        fluidState.setPressure(FluidSystem::wPhaseIdx, /*pressure=*/1e5);
-        fluidState.setPressure(FluidSystem::nPhaseIdx, /*pressure=*/1e5);
+        fluidState.setPressure(waterPhaseIdx, /*pressure=*/1e5);
+        fluidState.setPressure(dnaplPhaseIdx, /*pressure=*/1e5);
 
-        Scalar densityW = FluidSystem::density(fluidState, FluidSystem::wPhaseIdx);
+        Scalar densityW = FluidSystem::density(fluidState, waterPhaseIdx);
 
         Scalar height = this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1];
         Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1];
@@ -144,8 +146,8 @@ public:
         Scalar factor = (width*alpha + (1.0 - alpha)*globalPos[0])/width;
 
         // hydrostatic pressure scaled by alpha
-        values[pwIdx] = 1e5 - factor*densityW*this->gravity()[1]*depth;
-        values[snIdx] = 0.0;
+        values[pressureH2OIdx] = 1e5 - factor*densityW*this->gravity()[1]*depth;
+        values[saturationDNAPLIdx] = 0.0;
 
         return values;
     }
@@ -165,7 +167,7 @@ public:
     {
         NumEqVector values(0.0);
         if (onInlet_(globalPos))
-            values[contiNEqIdx] = -0.04; // kg / (m * s)
+            values[contiDNAPLEqIdx] = -0.04; // kg / (m * s)
         return values;
     }
 
@@ -181,16 +183,16 @@ public:
         PrimaryVariables values;
         typename GET_PROP_TYPE(TypeTag, FluidState) fluidState;
         fluidState.setTemperature(temperature());
-        fluidState.setPressure(FluidSystem::wPhaseIdx, /*pressure=*/1e5);
-        fluidState.setPressure(FluidSystem::nPhaseIdx, /*pressure=*/1e5);
+        fluidState.setPressure(waterPhaseIdx, /*pressure=*/1e5);
+        fluidState.setPressure(dnaplPhaseIdx, /*pressure=*/1e5);
 
-        Scalar densityW = FluidSystem::density(fluidState, FluidSystem::wPhaseIdx);
+        Scalar densityW = FluidSystem::density(fluidState, waterPhaseIdx);
 
         Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1];
 
         // hydrostatic pressure
-        values[pwIdx] = 1e5 - densityW*this->gravity()[1]*depth;
-        values[snIdx] = 0.0;
+        values[pressureH2OIdx] = 1e5 - densityW*this->gravity()[1]*depth;
+        values[saturationDNAPLIdx] = 0;
         return values;
     }
 
diff --git a/test/porousmediumflow/2p/implicit/incompressible/spatialparams.hh b/test/porousmediumflow/2p/implicit/incompressible/spatialparams.hh
index 4f2c83b787b34b4cb06bb802e271fd8d0d3b2f75..d13ad5538855c8e0596a6b643bb28fa65483db4f 100644
--- a/test/porousmediumflow/2p/implicit/incompressible/spatialparams.hh
+++ b/test/porousmediumflow/2p/implicit/incompressible/spatialparams.hh
@@ -70,13 +70,13 @@ class TwoPTestSpatialParams : public FVSpatialParams<TypeTag>
     using Element = typename GridView::template Codim<0>::Entity;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
     static constexpr int dimWorld = GridView::dimensionworld;
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
 public:
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
     using PermeabilityType = Scalar;
 
     TwoPTestSpatialParams(const Problem& problem)
@@ -148,6 +148,16 @@ public:
         return outerMaterialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The global position
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::phase0Idx; }
+
 private:
     bool isInLens_(const GlobalPosition &globalPos) const
     {
diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh b/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh
index 9691077087cd2f78a019a655da5c556d30d02cd2..1e0ffe022c0155db3e82383b8e6dac23d3d1ca2a 100644
--- a/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh
+++ b/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh
@@ -99,7 +99,11 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
+
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
     enum
     {
@@ -109,12 +113,12 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
         temperatureIdx = Indices::temperatureIdx,
 
         //! equation indices
-        contiNEqIdx = Indices::contiNEqIdx,
+        contiN2EqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx,
         energyEqIdx = Indices::energyEqIdx,
 
         //! phase indices
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+        wPhaseIdx = FluidSystem::H2OIdx,
+        nPhaseIdx = FluidSystem::N2Idx,
 
         // world dimension
         dimWorld = GridView::dimensionworld
@@ -123,14 +127,10 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
-
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
 public:
     /*!
@@ -243,7 +243,7 @@ public:
         if (globalPos[1] < 13.75 + eps_ && globalPos[1] > 6.875 - eps_)
         {
             // inject air. negative values mean injection
-            values[contiNEqIdx] = -1e-3; // kg/(s*m^2)
+            values[contiN2EqIdx] = -1e-3; // kg/(s*m^2)
 
             // compute enthalpy flux associated with this injection [(J/(kg*s)]
             using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
@@ -255,7 +255,7 @@ public:
             fs.setTemperature(initialValues[temperatureIdx]);
 
             // energy flux is mass flux times specific enthalpy
-            values[energyEqIdx] = values[contiNEqIdx]*FluidSystem::enthalpy(fs, nPhaseIdx);
+            values[energyEqIdx] = values[contiN2EqIdx]*FluidSystem::enthalpy(fs, nPhaseIdx);
         }
 
         return values;
diff --git a/test/porousmediumflow/2p/sequential/buckleyleverettanalyticsolution.hh b/test/porousmediumflow/2p/sequential/buckleyleverettanalyticsolution.hh
index fa12779e7ab53ff244d8ed12a8ed0203dc4fd53e..4dc1192b5383ac7e73abc2aeff469aa7155654d5 100644
--- a/test/porousmediumflow/2p/sequential/buckleyleverettanalyticsolution.hh
+++ b/test/porousmediumflow/2p/sequential/buckleyleverettanalyticsolution.hh
@@ -80,7 +80,7 @@ template<class TypeTag> class BuckleyLeverettAnalytic
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/test/porousmediumflow/2p/sequential/mcwhorteranalyticsolution.hh b/test/porousmediumflow/2p/sequential/mcwhorteranalyticsolution.hh
index d672a03527391aad65b00774645bbaf69045f0e9..76446673ced802fa88ca15ece537af5ae70c27be 100644
--- a/test/porousmediumflow/2p/sequential/mcwhorteranalyticsolution.hh
+++ b/test/porousmediumflow/2p/sequential/mcwhorteranalyticsolution.hh
@@ -56,7 +56,7 @@ class McWhorterAnalytic
     using SolutionTypes = typename GET_PROP(TypeTag, SolutionTypes);
     using PrimaryVariables = typename SolutionTypes::PrimaryVariables;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum
     {
diff --git a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh
index 57cfe6061a4cd8224226c7807b08d22431481dab..f7524a2951fa99e63eb3e4492b7aad7838d33116 100644
--- a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh
@@ -111,7 +111,7 @@ using ParentType = IMPESProblem2P<TypeTag>;
 using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 using Grid = typename GridView::Grid;
 
-using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
 using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh
index bcdcbd18e4c822225061a1bce50f690c70ffdd04..b64bee1e2c1529b9f9f26c97fa604c3681585718 100644
--- a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh
@@ -87,7 +87,7 @@ class TestIMPESAdaptiveProblem: public IMPESProblem2P<TypeTag>
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using WettingPhase = typename GET_PROP(TypeTag, FluidSystem)::WettingPhase;
 
diff --git a/test/porousmediumflow/2p/sequential/test_impesproblem.hh b/test/porousmediumflow/2p/sequential/test_impesproblem.hh
index d571d6e86a0cf0d1305fc62be87659133a38b01d..11de43b0c22617ca70477389ccc617353120f8d8 100644
--- a/test/porousmediumflow/2p/sequential/test_impesproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_impesproblem.hh
@@ -121,7 +121,7 @@ using ParentType = IMPESProblem2P<TypeTag>;
 using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 using Grid = typename GridView::Grid;
 
-using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
 using WettingPhase = typename GET_PROP(TypeTag, FluidSystem)::WettingPhase;
 
diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh
index 95424a7c3dd71084eec53c9b698fea28fcec9a0a..1e0cdd9f7dd7b5e8b89dcaca0dd3ab488589822b 100644
--- a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh
@@ -127,7 +127,7 @@ using ParentType = IMPESProblem2P<TypeTag>;
 using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 using Grid = typename GridView::Grid;
 
-using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
 using WettingPhase = typename GET_PROP(TypeTag, FluidSystem)::WettingPhase;
 
diff --git a/test/porousmediumflow/2p/sequential/test_transportproblem.hh b/test/porousmediumflow/2p/sequential/test_transportproblem.hh
index e325d5211be4daed75f15b25c282fa81f20ab474..67f89b0d68e56586d26555a0647af682659a6ef3 100644
--- a/test/porousmediumflow/2p/sequential/test_transportproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_transportproblem.hh
@@ -91,7 +91,7 @@ class TestTransportProblem: public TransportProblem2P<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Grid = typename GridView::Grid;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
diff --git a/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh b/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh
index 3e9251d6989e7853f6a32db38dbed788a613a995..e0944b388cb757f8a47516b09dc307540fa3d290 100644
--- a/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh
+++ b/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh
@@ -37,13 +37,11 @@
 
 #include "steaminjectionspatialparams.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 template <class TypeTag>
 class InjectionProblem;
 
-namespace Properties
-{
+namespace Properties {
 NEW_TYPE_TAG(InjectionProblemTypeTag, INHERITS_FROM(TwoPOneCNI, InjectionProblemSpatialParams));
 NEW_TYPE_TAG(TwoPOneCNIBoxTypeTag, INHERITS_FROM(BoxModel, InjectionProblemTypeTag));
 NEW_TYPE_TAG(TwoPOneCNICCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, InjectionProblemTypeTag));
@@ -67,7 +65,7 @@ public:
 
 //Define whether spurious cold-water flow into the steam is blocked
 SET_BOOL_PROP(InjectionProblemTypeTag, UseBlockingOfSpuriousFlow, true);
-}
+} // end namespace Properties
 
 /*!
  * \ingroup TwoPOneCTests
@@ -82,7 +80,7 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
@@ -98,13 +96,13 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
     // copy some indices for convenience
     enum {
         pressureIdx = Indices::pressureIdx,
-        switch1Idx = Indices::switch1Idx,
+        switchIdx = Indices::switchIdx,
 
         conti0EqIdx = Indices::conti0EqIdx,
         energyEqIdx = Indices::energyEqIdx,
 
         // phase state
-        wPhaseOnly = Indices::wPhaseOnly
+        liquidPhaseOnly = Indices::liquidPhaseOnly
     };
 
     static constexpr int dimWorld = GridView::dimensionworld;
@@ -229,9 +227,9 @@ public:
 
         const Scalar densityW = 1000.0;
         values[pressureIdx] = 101300.0 + (this->fvGridGeometry().bBoxMax()[1] - globalPos[1])*densityW*9.81; // hydrostatic pressure
-        values[switch1Idx] = 283.13;
+        values[switchIdx] = 283.13;
 
-        values.setState(wPhaseOnly);
+        values.setState(liquidPhaseOnly);
 
         return values;
     }
diff --git a/test/porousmediumflow/2p1c/implicit/steaminjectionspatialparams.hh b/test/porousmediumflow/2p1c/implicit/steaminjectionspatialparams.hh
index 4df9596a3b20ba6ceba963ecc7cec5fbe7fbbd78..f8ea4715bafa1df53f136cec37a72c90ac682f91 100644
--- a/test/porousmediumflow/2p1c/implicit/steaminjectionspatialparams.hh
+++ b/test/porousmediumflow/2p1c/implicit/steaminjectionspatialparams.hh
@@ -67,9 +67,6 @@ class InjectionProblemSpatialParams : public FVSpatialParams<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-
-    using MaterialLawParams = typename MaterialLaw::Params;
     using CoordScalar = typename GridView::ctype;
     using Element = typename GridView::template Codim<0>::Entity;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
@@ -80,6 +77,8 @@ class InjectionProblemSpatialParams : public FVSpatialParams<TypeTag>
     using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
     using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
 public:
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
     using PermeabilityType = DimWorldMatrix;
 
     /*!
diff --git a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh
index 3706e9f57dbdddca87f5cf9ea9b703451972710f..f2ca76aaf945cb23028d162cfe00c0856453b0ba 100644
--- a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh
+++ b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh
@@ -34,8 +34,7 @@
 
 #include "injectionspatialparams.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 
 #ifndef ENABLECACHING
 #define ENABLECACHING 0
@@ -44,8 +43,7 @@ namespace Dumux
 template <class TypeTag>
 class InjectionProblem;
 
-namespace Properties
-{
+namespace Properties {
 NEW_TYPE_TAG(InjectionTypeTag, INHERITS_FROM(TwoPTwoC, InjectionSpatialParams));
 NEW_TYPE_TAG(InjectionBoxTypeTag, INHERITS_FROM(BoxModel, InjectionTypeTag));
 NEW_TYPE_TAG(InjectionCCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, InjectionTypeTag));
@@ -69,8 +67,7 @@ SET_BOOL_PROP(InjectionTypeTag, UseMoles, true);
 SET_BOOL_PROP(InjectionTypeTag, EnableFVGridGeometryCache, ENABLECACHING);
 SET_BOOL_PROP(InjectionTypeTag, EnableGridVolumeVariablesCache, ENABLECACHING);
 SET_BOOL_PROP(InjectionTypeTag, EnableGridFluxVariablesCache, ENABLECACHING);
-}
-
+} // end namespace Properties
 
 /*!
  * \ingroup TwoPTwoCTests
@@ -102,26 +99,33 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 
-    enum {
-        pressureIdx = Indices::pressureIdx,
-        switchIdx = Indices::switchIdx,
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
-        // world dimension
-        dimWorld = GridView::dimensionworld
+    // primary variable indices
+    enum
+    {
+        pressureIdx = Indices::pressureIdx,
+        switchIdx = Indices::switchIdx
     };
 
-    enum {
-        nPhaseIdx = Indices::nPhaseIdx,
-
-        wPhaseOnly = Indices::wPhaseOnly,
+    // phase presence
+    enum { wPhaseOnly = Indices::firstPhaseOnly };
 
-        wCompIdx = FluidSystem::wCompIdx,
-        nCompIdx = FluidSystem::nCompIdx,
+    // equation indices
+    enum
+    {
+        contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
+        contiN2EqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx,
+    };
 
-        contiH2OEqIdx = Indices::contiWEqIdx,
-        contiN2EqIdx = Indices::contiNEqIdx
+    // phase indices
+    enum
+    {
+        gasPhaseIdx = FluidSystem::N2Idx,
+        H2OIdx = FluidSystem::H2OIdx,
+        N2Idx = FluidSystem::N2Idx
     };
 
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
@@ -129,12 +133,12 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
     //! property that defines whether mole or mass fractions are used
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = ModelTraits::useMoles();
 
 public:
     /*!
@@ -246,20 +250,20 @@ public:
      * Negative values indicate an inflow.
      */
     NumEqVector neumann(const Element& element,
-                          const FVElementGeometry& fvGeometry,
-                          const ElementVolumeVariables& elemVolVars,
-                          const SubControlVolumeFace& scvf) const
+                        const FVElementGeometry& fvGeometry,
+                        const ElementVolumeVariables& elemVolVars,
+                        const SubControlVolumeFace& scvf) const
     {
         NumEqVector values(0.0);
 
         const auto& globalPos = scvf.ipGlobal();
 
         Scalar injectedPhaseMass = 1e-3;
-        Scalar moleFracW = elemVolVars[scvf.insideScvIdx()].moleFraction(nPhaseIdx, wCompIdx);
+        Scalar moleFracW = elemVolVars[scvf.insideScvIdx()].moleFraction(gasPhaseIdx, H2OIdx);
         if (globalPos[1] < 14 - eps_ && globalPos[1] > 6.5 - eps_)
         {
-            values[contiN2EqIdx] = -(1-moleFracW)*injectedPhaseMass/FluidSystem::molarMass(nCompIdx); //mole/(m^2*s) -> kg/(s*m^2)
-            values[contiH2OEqIdx] = -moleFracW*injectedPhaseMass/FluidSystem::molarMass(wCompIdx); //mole/(m^2*s) -> kg/(s*m^2)
+            values[contiN2EqIdx] = -(1-moleFracW)*injectedPhaseMass/FluidSystem::molarMass(N2Idx); //mole/(m^2*s) -> kg/(s*m^2)
+            values[contiH2OEqIdx] = -moleFracW*injectedPhaseMass/FluidSystem::molarMass(H2OIdx); //mole/(m^2*s) -> kg/(s*m^2)
         }
         return values;
     }
@@ -279,9 +283,7 @@ public:
      * \param globalPos The global position
      */
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
-    {
-        return initial_(globalPos);
-    }
+    { return initial_(globalPos); }
 
     // \}
 
@@ -307,8 +309,8 @@ private:
         Scalar moleFracLiquidH2O = 1.0 - moleFracLiquidN2;
 
         Scalar meanM =
-            FluidSystem::molarMass(wCompIdx)*moleFracLiquidH2O +
-            FluidSystem::molarMass(nCompIdx)*moleFracLiquidN2;
+            FluidSystem::molarMass(H2OIdx)*moleFracLiquidH2O +
+            FluidSystem::molarMass(N2Idx)*moleFracLiquidN2;
         if(useMoles)
         {
             //mole-fraction formulation
@@ -317,7 +319,7 @@ private:
         else
         {
             //mass fraction formulation
-            Scalar massFracLiquidN2 = moleFracLiquidN2*FluidSystem::molarMass(nCompIdx)/meanM;
+            Scalar massFracLiquidN2 = moleFracLiquidN2*FluidSystem::molarMass(N2Idx)/meanM;
             priVars[switchIdx] = massFracLiquidN2;
         }
         priVars[pressureIdx] = pl;
diff --git a/test/porousmediumflow/2p2c/implicit/injectionspatialparams.hh b/test/porousmediumflow/2p2c/implicit/injectionspatialparams.hh
index 6ea53545fc8d26dc434045d546e4ee5ea0240488..8e7a4e44efb6b3a0b2b88a242a51755bacb73ad5 100644
--- a/test/porousmediumflow/2p2c/implicit/injectionspatialparams.hh
+++ b/test/porousmediumflow/2p2c/implicit/injectionspatialparams.hh
@@ -66,8 +66,6 @@ class InjectionSpatialParams : public FVSpatialParams<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
     static constexpr int dimWorld = GridView::dimensionworld;
 
@@ -75,15 +73,18 @@ class InjectionSpatialParams : public FVSpatialParams<TypeTag>
     using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
 
 public:
+    //! export the type used for the permeability
     using PermeabilityType = Scalar;
+    //! export the material law type used
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
 
     /*!
      * \brief The constructor
      *
      * \param gridView The grid view
      */
-    InjectionSpatialParams(const Problem& problem)
-    : ParentType(problem)
+    InjectionSpatialParams(const Problem& problem) : ParentType(problem)
     {
         layerBottom_ = 22.5;
 
@@ -179,6 +180,16 @@ public:
     Scalar solidThermalConductivityAtPos(const GlobalPosition& globalPos) const
     { return lambdaSolid_; }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
 private:
     bool isFineMaterial_(const GlobalPosition &globalPos) const
     { return globalPos[dimWorld-1] > layerBottom_; }
diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh
index 10e8ddaacaa8c6fd7286447d2fa323e5e0a2bca7..04dc86ba0ca3ce3ea57621640219c50b203cca69 100644
--- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh
+++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh
@@ -68,20 +68,16 @@ SET_TYPE_PROP(TwoPTwoCComparisonTypeTag,
 
 // decide which type to use for floating values (double / quad)
 SET_TYPE_PROP(TwoPTwoCComparisonTypeTag, Scalar, double);
-SET_INT_PROP(TwoPTwoCComparisonTypeTag, Formulation, TwoPTwoCFormulation::pnsw);
-
-SET_BOOL_PROP(TwoPTwoCComparisonTypeTag, UseMoles, true);
-
-SET_PROP(TwoPTwoCComparisonTypeTag, VtkOutputFields)
+SET_PROP(TwoPTwoCComparisonTypeTag, Formulation)
 {
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
 public:
-    using type = TwoPTwoCMPNCVtkOutputFields<FluidSystem, Indices>;
+    static const TwoPFormulation value = TwoPFormulation::p1s0;
 };
-}
+
+SET_BOOL_PROP(TwoPTwoCComparisonTypeTag, UseMoles, true);
+
+SET_TYPE_PROP(TwoPTwoCComparisonTypeTag, VtkOutputFields, TwoPTwoCMPNCVtkOutputFields);
+} // end namespace Properties
 
 
 /*!
@@ -90,12 +86,10 @@ public:
  *
  */
 template <class TypeTag>
-class TwoPTwoCComparisonProblem
-    : public PorousMediumFlowProblem<TypeTag>
+class TwoPTwoCComparisonProblem : public PorousMediumFlowProblem<TypeTag>
 {
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
@@ -105,26 +99,11 @@ class TwoPTwoCComparisonProblem
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
 
-    // world dimension
-    enum {dimWorld = GridView::dimensionworld};
-    enum {numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()};
-    enum {numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()};
-    enum {nPhaseIdx = FluidSystem::nPhaseIdx};
-    enum {wPhaseIdx = FluidSystem::wPhaseIdx};
-    enum {wCompIdx = FluidSystem::wCompIdx};
-    enum {nCompIdx = FluidSystem::nCompIdx};
-    enum
-    {
-        pressureIdx = Indices::pressureIdx,
-        switchIdx = Indices::switchIdx,
-        contiH2OEqIdx = Indices::contiWEqIdx,
-        contiN2EqIdx = Indices::contiNEqIdx
-    };
-
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-    static constexpr bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box;
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
 public:
     /*!
@@ -222,11 +201,9 @@ public:
         NeumannFluxes values(0.0);
         const auto& globalPos = scvf.ipGlobal();
         Scalar injectedAirMass = -1e-3;
-        Scalar injectedAirMolarMass = injectedAirMass/FluidSystem::molarMass(nCompIdx);
+        Scalar injectedAirMolarMass = injectedAirMass/FluidSystem::molarMass(FluidSystem::N2Idx);
         if (onInlet_(globalPos))
-        {
-          values[Indices::conti0EqIdx+1] = injectedAirMolarMass;
-        }
+            values[Indices::conti0EqIdx + FluidSystem::N2Idx] = injectedAirMolarMass;
         return values;
     }
 
@@ -253,8 +230,8 @@ private:
     PrimaryVariables initial_(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values[pressureIdx] = 1e5;
-        values[switchIdx] = 0.8;
+        values[Indices::pressureIdx] = 1e5; // air pressure
+        values[Indices::switchIdx] = 0.8; // water saturation
         values.setState(Indices::bothPhases);
 
         return values;
diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_spatialparams.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_spatialparams.hh
index 6f8871457215dfae75c93e0f3ad9512b3751b5ba..9800b5a6b210b7547b9da36bb07a0252b9d484df 100644
--- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_spatialparams.hh
+++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_spatialparams.hh
@@ -80,17 +80,18 @@ class TwoPTwoCComparisonSpatialParams : public FVSpatialParams<TypeTag>
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
     enum {dimWorld=GridView::dimensionworld};
 
 public:
-     using PermeabilityType = Scalar;
+    //! export permeability type
+    using PermeabilityType = Scalar;
+    //! export the type used for the material law
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
 
 
-    TwoPTwoCComparisonSpatialParams(const Problem &problem)
-        : ParentType(problem)
+    TwoPTwoCComparisonSpatialParams(const Problem &problem) : ParentType(problem)
     {
         // intrinsic permeabilities
         coarseK_ = 1e-12;
@@ -153,6 +154,16 @@ public:
             return coarseMaterialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
 private:
     /*!
      * \brief Returns whether a given global position is in the
diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh
index 25bfdc159c05560995e6578f69eed7c2b629c698..038c4b4a814f47291f9b84850da206a32b85ae16 100644
--- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh
+++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh
@@ -24,43 +24,40 @@
 #ifndef DUMUX_TWOPTWOC_MPNC_VTK_OUTPUT_FIELDS_HH
 #define DUMUX_TWOPTWOC_MPNC_VTK_OUTPUT_FIELDS_HH
 
-#include <dumux/common/properties.hh>
-
-namespace Dumux
-{
+namespace Dumux {
 
 /*!
  * \ingroup TwoPTwoCModel
  * \brief Adds vtk output fields specific to the two-phase two-component model
  */
-template<class FluidSystem, class Indices>
 class TwoPTwoCMPNCVtkOutputFields
 {
-
 public:
     template <class VtkOutputModule>
     static void init(VtkOutputModule& vtk)
     {
+        using VolumeVariables = typename VtkOutputModule::VolumeVariables;
+        using FluidSystem = typename VolumeVariables::FluidSystem;
+
         // register standardized vtk output fields
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
-        vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
-        vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
+        vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase1Idx); }, "Sn");
+        vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase0Idx); }, "Sw");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase1Idx); }, "pn");
+        vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase0Idx); }, "pw");
 
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "rhoW");
-        vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::nPhaseIdx); }, "rhoN");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW");
-        vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN");
+        vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase0Idx); }, "rhoW");
+        vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase1Idx); }, "rhoN");
+        vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase0Idx); }, "mobW");
+        vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase1Idx); }, "mobN");
 
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
                 vtk.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); },"X_"+ FluidSystem::phaseName(i) + "^" + FluidSystem::componentName(j));
 
-        for (int i = 0; i < FluidSystem::numPhases; ++i)
-            for (int j = 0; j < FluidSystem::numComponents; ++j)
+        for (int i = 0; i < VolumeVariables::numPhases(); ++i)
+            for (int j = 0; j < VolumeVariables::numComponents(); ++j)
                 vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x_"+ FluidSystem::phaseName(i) + "^" + FluidSystem::componentName(j));
-
-        vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
     }
 };
 
diff --git a/test/porousmediumflow/2p2c/implicit/waterairproblem.hh b/test/porousmediumflow/2p2c/implicit/waterairproblem.hh
index b6c27b8a9dd57fe556d458646a66b98c5b1c6c7b..983fcd2e1a54faf2dc4c53fc3bd4d78fcdf9cd85 100644
--- a/test/porousmediumflow/2p2c/implicit/waterairproblem.hh
+++ b/test/porousmediumflow/2p2c/implicit/waterairproblem.hh
@@ -36,8 +36,7 @@
 
 #include "waterairspatialparams.hh"
 
-namespace Dumux
-{
+namespace Dumux {
 /*!
  * \ingroup TwoPTwoCTests
  * \brief Non-isothermal gas injection problem where a gas (e.g. air)
@@ -46,8 +45,7 @@ namespace Dumux
 template <class TypeTag>
 class WaterAirProblem;
 
-namespace Properties
-{
+namespace Properties {
 NEW_TYPE_TAG(WaterAirTypeTag, INHERITS_FROM(TwoPTwoCNI, WaterAirSpatialParams));
 NEW_TYPE_TAG(WaterAirBoxTypeTag, INHERITS_FROM(BoxModel, WaterAirTypeTag));
 NEW_TYPE_TAG(WaterAirCCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, WaterAirTypeTag));
@@ -63,8 +61,7 @@ SET_TYPE_PROP(WaterAirTypeTag, FluidSystem, FluidSystems::H2ON2<typename GET_PRO
 
 // Define whether mole(true) or mass (false) fractions are used
 SET_BOOL_PROP(WaterAirTypeTag, UseMoles, true);
-}
-
+} // end namespace Dumux
 
 /*!
  * \ingroup TwoPTwoCModel
@@ -103,43 +100,47 @@ SET_BOOL_PROP(WaterAirTypeTag, UseMoles, true);
 template <class TypeTag >
 class WaterAirProblem : public PorousMediumFlowProblem<TypeTag>
 {
+    using ParentType = PorousMediumFlowProblem<TypeTag>;
+
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using ParentType = PorousMediumFlowProblem<TypeTag>;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
+    // primary variable indices
+    enum
+    {
         pressureIdx = Indices::pressureIdx,
         switchIdx = Indices::switchIdx,
-
-        nCompIdx = FluidSystem::nCompIdx,
-
         temperatureIdx = Indices::temperatureIdx,
-        energyEqIdx = Indices::energyEqIdx,
-
-        // phase state
-        wPhaseOnly = Indices::wPhaseOnly,
-
-        // world dimension
-        dimWorld = GridView::dimensionworld,
+        energyEqIdx = Indices::energyEqIdx
+    };
 
-        conti0EqIdx = Indices::conti0EqIdx,
-        contiNEqIdx = conti0EqIdx + Indices::nCompIdx
+    // equation indices
+    enum
+    {
+        contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
+        contiN2EqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx
     };
 
+    // phase presence
+    enum { wPhaseOnly = Indices::firstPhaseOnly };
+    // component index
+    enum { N2Idx = FluidSystem::N2Idx };
+
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
 
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-
     //! property that defines whether mole or mass fractions are used
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = ModelTraits::useMoles();
 
 public:
     /*!
@@ -230,7 +231,7 @@ public:
         // we inject pure gasious nitrogen at the initial condition temperature and pressure  from the bottom (negative values mean injection)
         if (globalPos[0] > 14.8 - eps_ && globalPos[0] < 25.2 + eps_ && globalPos[1] < eps_)
         {
-            values[contiNEqIdx] = useMoles ? -1e-3/FluidSystem::molarMass(nCompIdx) : -1e-3; // kg/(m^2*s) or mole/(m^2*s)
+            values[contiN2EqIdx] = useMoles ? -1e-3/FluidSystem::molarMass(N2Idx) : -1e-3; // kg/(m^2*s) or mole/(m^2*s)
 
             const auto initialValues = initial_(globalPos);
             const auto& mParams = this->spatialParams().materialLawParamsAtPos(globalPos);
diff --git a/test/porousmediumflow/2p2c/implicit/waterairspatialparams.hh b/test/porousmediumflow/2p2c/implicit/waterairspatialparams.hh
index 3ab234360acd2a7457af97a1310612acefcaecbb..cce22dd6d78ecb1550e810d99d9222fd38f7ef65 100644
--- a/test/porousmediumflow/2p2c/implicit/waterairspatialparams.hh
+++ b/test/porousmediumflow/2p2c/implicit/waterairspatialparams.hh
@@ -71,23 +71,24 @@ class WaterAirSpatialParams : public FVSpatialParams<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
     using CoordScalar = typename GridView::ctype;
 
     static constexpr int dimWorld = GridView::dimensionworld;
     using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
 
 public:
+    //! export the type used for the permeability
     using PermeabilityType = Scalar;
+    //! export the type used for the material law
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
 
     /*!
      * \brief The constructor
      *
      * \param gridView The grid view
      */
-    WaterAirSpatialParams(const Problem& problem)
-    : ParentType(problem)
+    WaterAirSpatialParams(const Problem& problem) : ParentType(problem)
     {
         layerBottom_ = 22.0;
 
@@ -221,6 +222,16 @@ public:
     Scalar solidThermalConductivityAtPos(const GlobalPosition& globalPos) const
     { return lambdaSolid_; }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
 private:
     bool isFineMaterial_(const GlobalPosition &globalPos) const
     { return globalPos[dimWorld-1] > layerBottom_; }
diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh
index fe66e685cbfb48f4896973658ebd7a179af90bbb..675cb91e5823926a2852c135a55bf3f4116e10b9 100644
--- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh
+++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh
@@ -104,7 +104,7 @@ using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
 using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
 
-using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
 using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh
index 9f31b0ac391ebf22e45a9b85590cd0e85129698d..7214627b8b20fe53f44c731957b845fd188418a0 100644
--- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh
+++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh
@@ -104,7 +104,7 @@ using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
 using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
 
-using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
 
diff --git a/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh b/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh
index 3c73abd295094171eaae25c07aedc17ba2255c2d..eed9ce4baf09d30424be0bd258fd9531518752e9 100644
--- a/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh
+++ b/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh
@@ -91,7 +91,7 @@ using ParentType = IMPETProblem2P2C<TypeTag>;
 using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 using Grid = typename GridView::Grid;
 using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
-using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
 using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
diff --git a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh
index 1d669a106aed8af17c16ea09ad9c68e68f098072..52a7e42ee9db2d05cb9276a067381a6c2730a0a1 100644
--- a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh
+++ b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh
@@ -98,7 +98,7 @@ using ParentType = IMPETProblem2P2C<TypeTag>;
 using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 using Grid = typename GridView::Grid;
 using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
-using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
 using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
diff --git a/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh b/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh
index 74c5dd59f4850c8ef3910d12e55742db45e114ae..aaf0a9653ea7b2ae97bf84019699874e0c6499f5 100644
--- a/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh
+++ b/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh
@@ -66,8 +66,10 @@ SET_BOOL_PROP(TwoPNCDiffusionTypeTag, UseMoles, true);
 SET_TYPE_PROP(TwoPNCDiffusionTypeTag, MolecularDiffusionType, DIFFUSIONTYPE);
 
 //! Set the default formulation to pw-Sn: This can be over written in the problem.
-SET_INT_PROP(TwoPNCDiffusionTypeTag, Formulation, TwoPNCFormulation::pwsn);
-}
+SET_PROP(TwoPNCDiffusionTypeTag, Formulation)
+{ static constexpr auto value = TwoPFormulation::p0s1; };
+
+} // end namespace Properties
 
 
 /*!
@@ -88,24 +90,7 @@ class TwoPNCDiffusionProblem : public PorousMediumFlowProblem<TypeTag>
         dimWorld = GridView::dimensionworld
     };
 
-    // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
-        pressureIdx = Indices::pressureIdx,
-        switchIdx = Indices::switchIdx,
-
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
-
-        wCompIdx = FluidSystem::wCompIdx,
-        nCompIdx = FluidSystem::nCompIdx,
-
-        wPhaseOnly = Indices::wPhaseOnly,
-
-        contiH2OEqIdx = Indices::contiWEqIdx,
-        contiN2EqIdx = Indices::contiNEqIdx
-    };
-
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
@@ -192,12 +177,12 @@ public:
     PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
     {
          PrimaryVariables priVars;
-         priVars.setState(wPhaseOnly);
-         priVars[pressureIdx] = 1e5;
-         priVars[switchIdx] = 1e-5 ;
+         priVars.setState(Indices::firstPhaseOnly);
+         priVars[Indices::pressureIdx] = 1e5;
+         priVars[Indices::switchIdx] = 1e-5 ;
 
          if (globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_)
-             priVars[switchIdx] = 1e-3;
+             priVars[Indices::switchIdx] = 1e-3;
 
         return priVars;
     }
@@ -252,11 +237,11 @@ private:
     PrimaryVariables initial_(const GlobalPosition &globalPos) const
     {
         PrimaryVariables priVars(0.0);
-        priVars.setState(wPhaseOnly);
+        priVars.setState(Indices::firstPhaseOnly);
 
         //mole-fraction formulation
-        priVars[switchIdx] = 1e-5;
-        priVars[pressureIdx] = 1e5;
+        priVars[Indices::switchIdx] = 1e-5;
+        priVars[Indices::pressureIdx] = 1e5;
         return priVars;
     }
 
diff --git a/test/porousmediumflow/2pnc/implicit/2pncdiffusionspatialparams.hh b/test/porousmediumflow/2pnc/implicit/2pncdiffusionspatialparams.hh
index 554dcfd07f795867d87bd361279d11b787ab345b..eb7a7abb6b2b8c26a2c3ec021ce817e59f716170 100644
--- a/test/porousmediumflow/2pnc/implicit/2pncdiffusionspatialparams.hh
+++ b/test/porousmediumflow/2pnc/implicit/2pncdiffusionspatialparams.hh
@@ -136,6 +136,16 @@ public:
     const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
     { return materialParams_; }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
 private:
     DimWorldMatrix K_;
     Scalar porosity_;
diff --git a/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh b/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh
index 43339c3b368c23fc56290c6e132f7b7b0007d8f5..62d710d797b99781ff8bb85d5c4b1a77afd15580 100644
--- a/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh
+++ b/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh
@@ -54,7 +54,8 @@ SET_TYPE_PROP(FuelCellTypeTag, Grid, Dune::YaspGrid<2>);
 // Set the problem property
 SET_TYPE_PROP(FuelCellTypeTag, Problem, FuelCellProblem<TypeTag>);
 // Set the primary variable combination for the 2pnc model
-SET_INT_PROP(FuelCellTypeTag, Formulation, TwoPNCFormulation::pnsw);
+SET_PROP(FuelCellTypeTag, Formulation)
+{ static constexpr auto value = TwoPFormulation::p1s0; };
 
 // Set fluid configuration
 SET_PROP(FuelCellTypeTag, FluidSystem)
@@ -81,7 +82,7 @@ class FuelCellProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
@@ -95,20 +96,7 @@ class FuelCellProblem : public PorousMediumFlowProblem<TypeTag>
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     // Select the electrochemistry method
-    using ElectroChemistry = typename Dumux::ElectroChemistry<Scalar, Indices, FVGridGeometry, ElectroChemistryModel::Ochs>;
-
-    enum { numComponents = FluidSystem::numComponents };
-
-    enum { wPhaseIdx = Indices::wPhaseIdx };
-
-    enum { bothPhases = Indices::bothPhases };
-
-    // privar indices
-    enum
-    {
-        pressureIdx = Indices::pressureIdx, //gas-phase pressure
-        switchIdx = Indices::switchIdx //liquid saturation or mole fraction
-    };
+    using ElectroChemistry = typename Dumux::ElectroChemistry<Scalar, Indices, FluidSystem, FVGridGeometry, ElectroChemistryModel::Ochs>;
 
     static constexpr int dim = GridView::dimension;
     static constexpr int dimWorld = GridView::dimensionworld;
@@ -222,9 +210,9 @@ public:
         if(onUpperBoundary_(globalPos))
         {
             Scalar pn = 1.0e5;
-            priVars[pressureIdx] = pn;
-            priVars[switchIdx] = 0.3;//Sw for bothPhases
-            priVars[switchIdx+1] = pO2Inlet_/4.315e9; //moleFraction xlO2 for bothPhases
+            priVars[Indices::pressureIdx] = pn;
+            priVars[Indices::switchIdx] = 0.3;//Sw for bothPhases
+            priVars[Indices::switchIdx+1] = pO2Inlet_/4.315e9; //moleFraction xlO2 for bothPhases
         }
 
         return priVars;
@@ -287,8 +275,8 @@ public:
                     auto i = ElectroChemistry::calculateCurrentDensity(volVars);
                     ElectroChemistry::reactionSource(source, i);
 
-                    reactionSourceH2O_[dofIdxGlobal] = source[wPhaseIdx];
-                    reactionSourceO2_[dofIdxGlobal] = source[numComponents-1];
+                    reactionSourceH2O_[dofIdxGlobal] = source[Indices::conti0EqIdx + FluidSystem::H2OIdx];
+                    reactionSourceO2_[dofIdxGlobal] = source[Indices::conti0EqIdx + FluidSystem::O2Idx];
 
                     //Current Output in A/cm^2
                     currentDensity_[dofIdxGlobal] = i/10000;
@@ -310,12 +298,12 @@ private:
     PrimaryVariables initial_(const GlobalPosition &globalPos) const
     {
         PrimaryVariables priVars(0.0);
-        priVars.setState(bothPhases);
+        priVars.setState(Indices::bothPhases);
 
         Scalar pn = 1.0e5;
-        priVars[pressureIdx] = pn;
-        priVars[switchIdx] = 0.3;//Sw for bothPhases
-        priVars[switchIdx+1] = pO2Inlet_/4.315e9; //moleFraction xlO2 for bothPhases
+        priVars[Indices::pressureIdx] = pn;
+        priVars[Indices::switchIdx] = 0.3;//Sw for bothPhases
+        priVars[Indices::switchIdx+1] = pO2Inlet_/4.315e9; //moleFraction xlO2 for bothPhases
 
         return priVars;
     }
diff --git a/test/porousmediumflow/2pnc/implicit/fuelcellspatialparams.hh b/test/porousmediumflow/2pnc/implicit/fuelcellspatialparams.hh
index 35f823b1cc47ee4273f61674a1ae7c4700cef080..f12a2dddadd264c1235b350c4ecefdbe08640005 100644
--- a/test/porousmediumflow/2pnc/implicit/fuelcellspatialparams.hh
+++ b/test/porousmediumflow/2pnc/implicit/fuelcellspatialparams.hh
@@ -81,9 +81,6 @@ class FuelCellSpatialParams : public FVSpatialParams<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-
-    using MaterialLawParams = typename MaterialLaw::Params;
     using CoordScalar = typename GridView::ctype;
     using Element = typename GridView::template Codim<0>::Entity;
 
@@ -93,6 +90,8 @@ class FuelCellSpatialParams : public FVSpatialParams<TypeTag>
     using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
 
 public:
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
     using PermeabilityType = DimWorldMatrix;
 
     /*!
@@ -148,6 +147,16 @@ public:
     const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
     { return materialParams_; }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
 private:
     DimWorldMatrix K_;
     Scalar porosity_;
diff --git a/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh b/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh
index 0508b9f3e1dd18a676d2e1cb21d8a6d953553e6f..076d17a322a07b4b5df63e98bd883e70ef752dca 100644
--- a/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh
+++ b/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh
@@ -67,8 +67,10 @@ SET_TYPE_PROP(DissolutionTypeTag, SpatialParams, DissolutionSpatialparams<TypeTa
 
 //Set properties here to override the default property settings
 SET_INT_PROP(DissolutionTypeTag, ReplaceCompEqIdx, 1); //!< Replace gas balance by total mass balance
-SET_INT_PROP(DissolutionTypeTag, Formulation, TwoPNCFormulation::pnsw);
-}
+SET_PROP(DissolutionTypeTag, Formulation)
+{ static constexpr auto value = TwoPFormulation::p1s0; };
+
+} // end namespace Properties
 
 /*!
  * \ingroup TwoPNCMinModel
@@ -96,24 +98,32 @@ class DissolutionProblem : public PorousMediumFlowProblem<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
-    enum {
+    enum
+    {
+        // primary variable indices
         pressureIdx = Indices::pressureIdx,
-        switchIdx = Indices::switchIdx, //Saturation
+        switchIdx = Indices::switchIdx,
+
+        // component indices
+        // TODO: using xwNaClIdx as privaridx works here, but
+        //       looks like magic. Can this be done differently??
         xwNaClIdx = FluidSystem::NaClIdx,
         precipNaClIdx = FluidSystem::numComponents,
 
-        //Indices of the components
-        wCompIdx = FluidSystem::H2OIdx,
+        // Indices of the components
+        H2OIdx = FluidSystem::H2OIdx,
         NaClIdx = FluidSystem::NaClIdx,
 
-        //Indices of the phases
-        wPhaseIdx = FluidSystem::wPhaseIdx,
-        nPhaseIdx = FluidSystem::nPhaseIdx,
-        sPhaseIdx = FluidSystem::sPhaseIdx,
+        // Indices of the phases
+        liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
+        gasPhaseIdx = FluidSystem::gasPhaseIdx,
+
+        // TODO: this shouldn't be in the fluid system
+        sPhaseIdx = FluidSystem::solidPhaseIdx,
 
-        //Index of the primary component of G and L phase
+        // Index of the primary component of G and L phase
         conti0EqIdx = Indices::conti0EqIdx,
         precipNaClEqIdx = Indices::conti0EqIdx + FluidSystem::numComponents,
 
@@ -323,25 +333,25 @@ public:
 
         const auto& volVars = elemVolVars[scv];
 
-        Scalar moleFracNaCl_wPhase = volVars.moleFraction(wPhaseIdx, NaClIdx);
-        Scalar moleFracNaCl_nPhase = volVars.moleFraction(nPhaseIdx, NaClIdx);
+        Scalar moleFracNaCl_wPhase = volVars.moleFraction(liquidPhaseIdx, NaClIdx);
+        Scalar moleFracNaCl_nPhase = volVars.moleFraction(gasPhaseIdx, NaClIdx);
         Scalar massFracNaCl_Max_wPhase = this->spatialParams().solubilityLimit();
         Scalar moleFracNaCl_Max_wPhase = massToMoleFrac_(massFracNaCl_Max_wPhase);
-        Scalar moleFracNaCl_Max_nPhase = moleFracNaCl_Max_wPhase / volVars.pressure(nPhaseIdx);
+        Scalar moleFracNaCl_Max_nPhase = moleFracNaCl_Max_wPhase / volVars.pressure(gasPhaseIdx);
         Scalar saltPorosity = this->spatialParams().minPorosity(element, scv);
 
         // liquid phase
         using std::abs;
-        Scalar precipSalt = volVars.porosity() * volVars.molarDensity(wPhaseIdx)
-                                               * volVars.saturation(wPhaseIdx)
+        Scalar precipSalt = volVars.porosity() * volVars.molarDensity(liquidPhaseIdx)
+                                               * volVars.saturation(liquidPhaseIdx)
                                                * abs(moleFracNaCl_wPhase - moleFracNaCl_Max_wPhase);
 
         if (moleFracNaCl_wPhase < moleFracNaCl_Max_wPhase)
             precipSalt *= -1;
 
         // gas phase
-        precipSalt += volVars.porosity() * volVars.molarDensity(nPhaseIdx)
-                                         * volVars.saturation(nPhaseIdx)
+        precipSalt += volVars.porosity() * volVars.molarDensity(gasPhaseIdx)
+                                         * volVars.saturation(gasPhaseIdx)
                                          * abs(moleFracNaCl_nPhase - moleFracNaCl_Max_nPhase);
 
         // make sure we don't dissolve more salt than previously precipitated
@@ -394,7 +404,7 @@ private:
      */
     static Scalar massToMoleFrac_(Scalar XwNaCl)
     {
-       const Scalar Mw = 18.015e-3; //FluidSystem::molarMass(wCompIdx); /* molecular weight of water [kg/mol] */ //TODO use correct link to FluidSyswem later
+       const Scalar Mw = 18.015e-3; //FluidSystem::molarMass(H2OIdx); /* molecular weight of water [kg/mol] */ //TODO use correct link to FluidSyswem later
        const Scalar Ms = 58.44e-3;  //FluidSystem::molarMass(NaClIdx); /* molecular weight of NaCl  [kg/mol] */
 
        const Scalar X_NaCl = XwNaCl;
diff --git a/test/porousmediumflow/2pncmin/implicit/dissolutionspatialparams.hh b/test/porousmediumflow/2pncmin/implicit/dissolutionspatialparams.hh
index 0cd4526dcddbc812e43cd09a43a57be926628907..4af312062de70898fcf77306de814c33930f9a21 100644
--- a/test/porousmediumflow/2pncmin/implicit/dissolutionspatialparams.hh
+++ b/test/porousmediumflow/2pncmin/implicit/dissolutionspatialparams.hh
@@ -170,6 +170,11 @@ public:
     const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
     { return materialParams_; }
 
+    // define which phase is to be considered as the wetting phase
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
 private:
 
     MaterialLawParams materialParams_;
diff --git a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh b/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh
index d6afb1bd2998901a4cba3ed3cc7b387f3005d4b0..f152e72d07371b8a1a2d99e910df9e64e2ea5565 100644
--- a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh
+++ b/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh
@@ -119,14 +119,14 @@ class ThreePNIConductionProblem : public PorousMediumFlowProblem<TypeTag>
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum {
         // index of the primary variables
         pressureIdx = Indices::pressureIdx,
         swIdx = Indices::swIdx,
         snIdx = Indices::snIdx,
         temperatureIdx = Indices::temperatureIdx,
-        wPhaseIdx = Indices::wPhaseIdx
+        wPhaseIdx = FluidSystem::wPhaseIdx
     };
 
     enum { dimWorld = GridView::dimensionworld };
diff --git a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh b/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh
index 4352cf847734fbb32b9b939394bf2c5f29fb5dc0..e00cf8a679358b31b81c63bba569b11b58c3d9cb 100644
--- a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh
+++ b/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh
@@ -119,14 +119,14 @@ class ThreePNIConvectionProblem : public PorousMediumFlowProblem<TypeTag>
     using IapwsH2O = Components::H2O<Scalar>;
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum {
         // index of the primary variables
         pressureIdx = Indices::pressureIdx,
         swIdx = Indices::swIdx,
         snIdx = Indices::snIdx,
         temperatureIdx = Indices::temperatureIdx,
-        wPhaseIdx = Indices::wPhaseIdx,
+        wPhaseIdx = FluidSystem::wPhaseIdx,
         conti0EqIdx = Indices::conti0EqIdx,
         energyEqIdx = Indices::energyEqIdx
     };
diff --git a/test/porousmediumflow/3p/implicit/infiltration3pproblem.hh b/test/porousmediumflow/3p/implicit/infiltration3pproblem.hh
index a9dd8e52944ed36627ac12d870570c75e177fd2f..94428de360a52cb17d05165eef58b2b0c625512f 100644
--- a/test/porousmediumflow/3p/implicit/infiltration3pproblem.hh
+++ b/test/porousmediumflow/3p/implicit/infiltration3pproblem.hh
@@ -119,7 +119,7 @@ class InfiltrationThreePProblem : public PorousMediumFlowProblem<TypeTag>
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
     enum {
         pressureIdx = Indices::pressureIdx,
@@ -251,7 +251,7 @@ public:
                  && (globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_))
             {
                 // mol fluxes, convert with M(Mesit.)=0,120 kg/mol --> 1.2e-4  kg/(sm)
-                values[Indices::contiNEqIdx] = -0.001;
+                values[Indices::conti0EqIdx + FluidSystem::nCompIdx] = -0.001;
             }
         }
 
diff --git a/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh b/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh
index 228530d693e3ab5650a40d495825dc1685dac8bb..f0b7843e9a6604e39daebbb27ed6bdb8d7068cb0 100644
--- a/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh
+++ b/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh
@@ -95,34 +95,38 @@ class ColumnProblem : public PorousMediumFlowProblem<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using ParentType = PorousMediumFlowProblem<TypeTag>;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-    enum {
+
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
+    enum
+    {
+        // primary variable indices
         pressureIdx = Indices::pressureIdx,
         switch1Idx = Indices::switch1Idx,
         switch2Idx = Indices::switch2Idx,
         temperatureIdx = Indices::temperatureIdx,
-        contiWEqIdx = Indices::contiWEqIdx,
-        contiGEqIdx = Indices::contiGEqIdx,
-        contiNEqIdx = Indices::contiNEqIdx,
+
+        // equation indices
         energyEqIdx = Indices::energyEqIdx,
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wCompIdx, //!< Index of the mass conservation equation for the water component,
+        contiGEqIdx = Indices::conti0EqIdx + FluidSystem::gCompIdx, //!< Index of the mass conservation equation for the gas component,
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nCompIdx, //!< Index of the mass conservation equation for the contaminant component
 
         // Phase State
-        threePhases = Indices::threePhases,
-
-        // world dimension
-        dimWorld = GridView::dimensionworld
+        threePhases = Indices::threePhases
     };
 
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
-    using GlobalPosition = Dune::FieldVector<typename GridView::ctype, dimWorld>;
 
 public:
     /*!
diff --git a/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh b/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh
index e3394126f162200095402946871afe322bcfc882..5203d005ac408d1864c3ec25aa816725ef88a79f 100644
--- a/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh
+++ b/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh
@@ -100,7 +100,8 @@ class InfiltrationThreePThreeCProblem : public PorousMediumFlowProblem<TypeTag>
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     // copy some indices for convenience
     enum {
@@ -111,9 +112,9 @@ class InfiltrationThreePThreeCProblem : public PorousMediumFlowProblem<TypeTag>
         // phase state
         wgPhaseOnly = Indices::wgPhaseOnly,
 
-        contiWEqIdx = Indices::conti0EqIdx, //!< Index of the mass conservation equation for the water component
-        contiNEqIdx = Indices::conti1EqIdx,//!< Index of the mass conservation equation for the contaminant component
-        contiAEqIdx = Indices::conti2EqIdx,//!< Index of the mass conservation equation for the gas component
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wCompIdx, //!< Index of the mass conservation equation for the water component
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nCompIdx,//!< Index of the mass conservation equation for the contaminant component
+        contiAEqIdx = Indices::conti0EqIdx + FluidSystem::gCompIdx,//!< Index of the mass conservation equation for the gas component
 
         // world dimension
         dimWorld = GridView::dimensionworld
@@ -122,7 +123,6 @@ class InfiltrationThreePThreeCProblem : public PorousMediumFlowProblem<TypeTag>
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
 
     using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
diff --git a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh b/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh
index 3a854ac6548f13780629ef7c6a15f475d2e8b7e1..0790059cca6c9a26211ad9f29e49080a562632e8 100644
--- a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh
+++ b/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh
@@ -109,16 +109,17 @@ class KuevetteProblem : public PorousMediumFlowProblem<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     enum {
 
         pressureIdx = Indices::pressureIdx,
         switch1Idx = Indices::switch1Idx,
         switch2Idx = Indices::switch2Idx,
         temperatureIdx = Indices::temperatureIdx,
-        contiWEqIdx = Indices::contiWEqIdx,
-        contiGEqIdx = Indices::contiGEqIdx,
-        contiNEqIdx = Indices::contiNEqIdx,
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wCompIdx,
+        contiGEqIdx = Indices::conti0EqIdx + FluidSystem::gCompIdx,
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nCompIdx,
         energyEqIdx = Indices::energyEqIdx,
 
         // phase states
@@ -135,7 +136,6 @@ class KuevetteProblem : public PorousMediumFlowProblem<TypeTag>
     using Element = typename GridView::template Codim<0>::Entity;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
diff --git a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh
index d92a0af07cbb611f57717011fe7099437d3ad32b..5926e6a334f7506269335455e0017f19e7fb2412 100644
--- a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh
+++ b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh
@@ -79,19 +79,19 @@ class SagdProblem : public PorousMediumFlowProblem<TypeTag>
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum {
         pressureIdx = Indices::pressureIdx,
         switch1Idx = Indices::switch1Idx,
         switch2Idx = Indices::switch2Idx,
 
-        contiWEqIdx = Indices::contiWEqIdx,
-        contiNEqIdx = Indices::contiNEqIdx,
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wCompIdx,
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nCompIdx,
         energyEqIdx = Indices::energyEqIdx,
 
         // phase indices
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+        wPhaseIdx = FluidSystem::wPhaseIdx,
+        nPhaseIdx = FluidSystem::nPhaseIdx,
 
         // phase state
         wnPhaseOnly = Indices::wnPhaseOnly,
diff --git a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdspatialparams.hh b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdspatialparams.hh
index 0f1135900a0b632c4dd443715691e0858566909e..cd91f5ebe5800a5a80524532c063b7ff019a06e3 100644
--- a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdspatialparams.hh
+++ b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdspatialparams.hh
@@ -78,8 +78,6 @@ class SagdSpatialParams : public FVSpatialParams<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     enum { dimWorld=GridView::dimensionworld };
@@ -89,6 +87,8 @@ class SagdSpatialParams : public FVSpatialParams<TypeTag>
     using Element = typename GridView::template Codim<0>::Entity;
 
 public:
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
     using PermeabilityType = Scalar;
 
     /*!
diff --git a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh
index 5fd7d7974c0e3d75ee045738429d64934d197b32..d37a1ed53d3f7b5462e416b14bccfa495b3ba75e 100644
--- a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh
+++ b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh
@@ -124,25 +124,25 @@ class HeterogeneousProblem : public PorousMediumFlowProblem<TypeTag>
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 
-    enum { dimWorld = GridView::dimensionworld };
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
 
     // copy some indices for convenience
-    enum {
+    enum
+    {
+        // primary variable indices
         pressureIdx = Indices::pressureIdx,
         switchIdx = Indices::switchIdx,
 
-        wPhaseIdx = Indices::wPhaseIdx,
-        nPhaseIdx = Indices::nPhaseIdx,
+        // phase presence index
+        firstPhaseOnly = Indices::firstPhaseOnly,
 
-        wPhaseOnly = Indices::wPhaseOnly,
-
-        nCompIdx = FluidSystem::nCompIdx,
+        // component indices
         BrineIdx = FluidSystem::BrineIdx,
-        CO2Idx = FluidSystem::CO2Idx
-    };
-    enum {
+        CO2Idx = FluidSystem::CO2Idx,
+
+        // equation indices
         conti0EqIdx = Indices::conti0EqIdx,
         contiCO2EqIdx = conti0EqIdx + CO2Idx
     };
@@ -158,19 +158,23 @@ class HeterogeneousProblem : public PorousMediumFlowProblem<TypeTag>
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-    using CO2 = Dumux::Components::CO2<Scalar, HeterogeneousCO2Tables::CO2Tables>;
+
+    using CO2 = Components::CO2<Scalar, HeterogeneousCO2Tables::CO2Tables>;
 
     //! property that defines whether mole or mass fractions are used
-    static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles);
+    static constexpr bool useMoles = ModelTraits::useMoles();
 
     // the discretization method we are using
     static constexpr auto discMethod = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod;
 
+    // world dimension to access gravity vector
+    static constexpr int dimWorld = GridView::dimensionworld;
+
 public:
     /*!
      * \brief The constructor
@@ -241,8 +245,8 @@ public:
         vtk.addField(vtkBoxVolume_, "boxVolume");
 
 #if !ISOTHERMAL
-        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.enthalpy(wPhaseIdx); }, "enthalpyW");
-        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.enthalpy(nPhaseIdx); }, "enthalpyN");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.enthalpy(BrineIdx); }, "enthalpyW");
+        vtk.addVolumeVariable([](const VolumeVariables& v){ return v.enthalpy(CO2Idx); }, "enthalpyN");
 #else
         vtkTemperature_.resize(numDofs, 0.0);
         vtk.addField(vtkTemperature_, "temperature");
@@ -376,7 +380,7 @@ public:
          // kg/(m^2*s) or mole/(m^2*s) depending on useMoles
         if (boundaryId == injectionBottom_)
         {
-            fluxes[contiCO2EqIdx] = useMoles ? -injectionRate_/FluidSystem::molarMass(nCompIdx) : -injectionRate_;
+            fluxes[contiCO2EqIdx] = useMoles ? -injectionRate_/FluidSystem::molarMass(CO2Idx) : -injectionRate_;
 #if !ISOTHERMAL
             // energy fluxes are always mass specific
             fluxes[energyEqIdx] = -injectionRate_/*kg/(m^2 s)*/*CO2::gasEnthalpy(
@@ -421,7 +425,7 @@ private:
     PrimaryVariables initial_(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values.setState(wPhaseOnly);
+        values.setState(firstPhaseOnly);
 
         const Scalar temp = initialTemperatureField_(globalPos);
         const Scalar densityW = FluidSystem::Brine::liquidDensity(temp, 1e7);
diff --git a/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh b/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh
index 891d092475c63fd32723cd9621e377ff6a662815..17dc8457f139dd3a20b09cdd182a2d3d870660cd 100644
--- a/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh
+++ b/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh
@@ -219,6 +219,16 @@ public:
         return materialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::BrineIdx; }
+
     /*!
      * \brief Returns the heat capacity \f$[J / (kg K)]\f$ of the rock matrix.
      *
diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh
index 7d7476b8c7995f8fecf854fe7f07e68e0b0f4abe..b7af9bb6c4f58f4c4ab8c2738449e233c272113c 100644
--- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh
+++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh
@@ -69,19 +69,8 @@ SET_TYPE_PROP(MPNCComparisonTypeTag,
 
 // decide which type to use for floating values (double / quad)
 SET_TYPE_PROP(MPNCComparisonTypeTag, Scalar, double);
-
 SET_BOOL_PROP(MPNCComparisonTypeTag, UseMoles, true);
-
-SET_PROP(MPNCComparisonTypeTag, VtkOutputFields)
-{
-private:
-   using FluidSystem =  typename GET_PROP_TYPE(TypeTag, FluidSystem);
-   using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-
-public:
-    using type = TwoPTwoCMPNCVtkOutputFields<FluidSystem, Indices>;
-};
-
+SET_TYPE_PROP(MPNCComparisonTypeTag, VtkOutputFields, TwoPTwoCMPNCVtkOutputFields);
 }
 
 
@@ -96,7 +85,7 @@ class MPNCComparisonProblem
 {
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
@@ -115,10 +104,10 @@ class MPNCComparisonProblem
     enum {dimWorld = GridView::dimensionworld};
     enum {numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()};
     enum {numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()};
-    enum {nPhaseIdx = FluidSystem::nPhaseIdx};
-    enum {wPhaseIdx = FluidSystem::wPhaseIdx};
-    enum {wCompIdx = FluidSystem::wCompIdx};
-    enum {nCompIdx = FluidSystem::nCompIdx};
+    enum {gasPhaseIdx = FluidSystem::gasPhaseIdx};
+    enum {liquidPhaseIdx = FluidSystem::liquidPhaseIdx};
+    enum {wCompIdx = FluidSystem::H2OIdx};
+    enum {nCompIdx = FluidSystem::N2Idx};
     enum {fug0Idx = Indices::fug0Idx};
     enum {s0Idx = Indices::s0Idx};
     enum {p0Idx = Indices::p0Idx};
@@ -269,21 +258,21 @@ private:
         fs.setTemperature(this->temperatureAtPos(globalPos));
 
         // set water saturation
-        fs.setSaturation(wPhaseIdx, 0.8);
-        fs.setSaturation(nPhaseIdx, 1.0 - fs.saturation(wPhaseIdx));
+        fs.setSaturation(liquidPhaseIdx, 0.8);
+        fs.setSaturation(gasPhaseIdx, 1.0 - fs.saturation(liquidPhaseIdx));
         // set pressure of the gas phase
-        fs.setPressure(nPhaseIdx, 1e5);
+        fs.setPressure(gasPhaseIdx, 1e5);
         // calulate the capillary pressure
         const auto& matParams =
             this->spatialParams().materialLawParamsAtPos(globalPos);
         PhaseVector pc;
         MaterialLaw::capillaryPressures(pc, matParams, fs);
-        fs.setPressure(wPhaseIdx,
-                       fs.pressure(nPhaseIdx) + pc[wPhaseIdx] - pc[nPhaseIdx]);
+        fs.setPressure(liquidPhaseIdx,
+                       fs.pressure(gasPhaseIdx) + pc[liquidPhaseIdx] - pc[gasPhaseIdx]);
 
         // make the fluid state consistent with local thermodynamic
         // equilibrium
-         using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FluidSystem, /*useKelvinEquation*/false>;
+         using MiscibleMultiPhaseComposition = Dumux::MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
 
         ParameterCache paramCache;
         MiscibleMultiPhaseComposition::solve(fs,
@@ -296,7 +285,7 @@ private:
 
         // all N component fugacities
         for (int compIdx = 0; compIdx < numComponents; ++compIdx)
-            values[fug0Idx + compIdx] = fs.fugacity(nPhaseIdx, compIdx);
+            values[fug0Idx + compIdx] = fs.fugacity(gasPhaseIdx, compIdx);
 
         // first M - 1 saturations
         for (int phaseIdx = 0; phaseIdx < numPhases - 1; ++phaseIdx)
diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_spatialparams.hh b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_spatialparams.hh
index d23f95be5d0a105e975b84549ebd0442ab9e754f..01c7045e9ac87c995a19ca39d461d78484e57fde 100644
--- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_spatialparams.hh
+++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_spatialparams.hh
@@ -56,15 +56,15 @@ SET_PROP(MPNCComparisonSpatialParams, MaterialLaw)
 {
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    enum {wPhaseIdx = FluidSystem::wPhaseIdx};
+    enum {liquidPhaseIdx = FluidSystem::liquidPhaseIdx};
     // define the material law
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using EffMaterialLaw = RegularizedBrooksCorey<Scalar>;
     using TwoPMaterialLaw = EffToAbsLaw<EffMaterialLaw>;
 public:
-    using type = TwoPAdapter<wPhaseIdx, TwoPMaterialLaw>;
+    using type = TwoPAdapter<liquidPhaseIdx, TwoPMaterialLaw>;
 };
-}
+} // end namespace Properties
 
 /**
  * \ingroup MPNCModel
@@ -83,17 +83,16 @@ class MPNCComparisonSpatialParams : public FVSpatialParams<TypeTag>
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
     enum {dimWorld=GridView::dimensionworld};
 
 public:
-     using PermeabilityType = Scalar;
-
+    using PermeabilityType = Scalar;
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
 
-    MPNCComparisonSpatialParams(const Problem &problem)
-        : ParentType(problem)
+    //! The constructor
+    MPNCComparisonSpatialParams(const Problem &problem) : ParentType(problem)
     {
         // intrinsic permeabilities
         coarseK_ = 1e-12;
diff --git a/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh b/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh
index 0688a0e8580b1302dfebfd1f33740d688a84ef72..3fa8ba66b22d9bed9a61c21a52c55f8a56c22655 100644
--- a/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh
+++ b/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh
@@ -67,13 +67,17 @@ public:
 
     static constexpr int wPhaseIdx = 0; // index of the wetting phase
     static constexpr int nPhaseIdx = 1; // index of the non-wetting phase
+    static constexpr int phase0Idx = 0; // index of the wetting phase
+    static constexpr int phase1Idx = 1; // index of the non-wetting phase
     static constexpr int sPhaseIdx = 2; // index of the solid phase
 
     // export component indices to indicate the main component
     // of the corresponding phase at atmospheric pressure 1 bar
     // and room temperature 20°C:
-    static const int wCompIdx = wPhaseIdx;
-    static const int nCompIdx = nPhaseIdx;
+    static constexpr int wCompIdx = wPhaseIdx;
+    static constexpr int nCompIdx = nPhaseIdx;
+    static constexpr int comp0Idx = 0; // index of the wetting phase
+    static constexpr int comp1Idx = 1; // index of the non-wetting phase
 
     /*!
      * \brief Return the human readable name of a fluid phase
diff --git a/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh b/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh
index 7ae025b8ffd77921ee06381ad0f6ac40e60f3f18..40bc98761db1f5593d7b27071ee1fde734897c9f 100644
--- a/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh
+++ b/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh
@@ -31,6 +31,7 @@
 
 #include <dumux/porousmediumflow/problem.hh>
 #include <dumux/porousmediumflow/mpnc/model.hh>
+#include <dumux/porousmediumflow/mpnc/pressureformulation.hh>
 
 
 #include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh>
@@ -46,8 +47,8 @@ template<class TypeTag>
 class CombustionProblemOneComponent;
 
 //! Custom model traits to deactivate diffusion for this test
-template<int numP, int numC>
-struct CombustionModelTraits : public MPNCModelTraits<numP, numC>
+template<int numP, int numC, MpNcPressureFormulation formulation>
+struct CombustionModelTraits : public MPNCModelTraits<numP, numC, formulation>
 {
     static constexpr bool enableMolecularDiffusion() { return false; }
 };
@@ -62,17 +63,19 @@ SET_TYPE_PROP(CombustionOneComponentTypeTag, Grid, Dune::OneDGrid);
 
 // Set the problem property
 SET_TYPE_PROP(CombustionOneComponentTypeTag,
-               Problem,
-               CombustionProblemOneComponent<TypeTag>);
+              Problem,
+              CombustionProblemOneComponent<TypeTag>);
 
 SET_TYPE_PROP(CombustionOneComponentTypeTag,
               FluidSystem,
               FluidSystems::CombustionFluidsystem<typename GET_PROP_TYPE(TypeTag, Scalar), /*useComplexRelations=*/false>);
 
 //! Set the default pressure formulation: either pw first or pn first
-SET_INT_PROP(CombustionOneComponentTypeTag,
-        PressureFormulation,
-        MpNcPressureFormulation::mostWettingFirst);
+SET_PROP(CombustionOneComponentTypeTag, PressureFormulation)
+{
+public:
+    static const MpNcPressureFormulation value = MpNcPressureFormulation::mostWettingFirst;
+};
 
 // Set the type used for scalar values
 SET_TYPE_PROP(CombustionOneComponentTypeTag, Scalar, double );
@@ -84,17 +87,9 @@ SET_PROP(CombustionOneComponentTypeTag, EquilibriumModelTraits)
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 public:
-    using type = CombustionModelTraits<FluidSystem::numPhases, FluidSystem::numComponents>;
-};
-
-//! Franz Lindners simple lumping
-SET_PROP(CombustionOneComponentTypeTag, ThermalConductivityModel)
-{
-private:
-    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
-public:
-    using type = ThermalConductivitySimpleFluidLumping<Scalar, GET_PROP_VALUE(TypeTag, NumEnergyEqFluid), Indices>;
+    using type = CombustionModelTraits< FluidSystem::numPhases,
+                                        FluidSystem::numComponents,
+                                        GET_PROP_VALUE(TypeTag, PressureFormulation) >;
 };
 
 SET_PROP(CombustionOneComponentTypeTag, FluidState)
@@ -126,7 +121,6 @@ class CombustionProblemOneComponent: public PorousMediumFlowProblem<TypeTag>
 {
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
@@ -137,21 +131,25 @@ class CombustionProblemOneComponent: public PorousMediumFlowProblem<TypeTag>
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
     using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
     using ParameterCache = typename FluidSystem::ParameterCache;
     using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
 
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
     enum {dimWorld = GridView::dimensionworld};
-    enum {numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()};
-    enum {numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()};
+    enum {numPhases = ModelTraits::numPhases()};
+    enum {numComponents = ModelTraits::numComponents()};
     enum {s0Idx = Indices::s0Idx};
     enum {p0Idx = Indices::p0Idx};
     enum {conti00EqIdx = Indices::conti0EqIdx};
     enum {energyEq0Idx = Indices::energyEqIdx};
-    enum {numEnergyEqFluid = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid)};
-    enum {numEnergyEqSolid = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid)};
+    enum {numEnergyEqFluid = ModelTraits::numEnergyEqFluid()};
+    enum {numEnergyEqSolid = ModelTraits::numEnergyEqSolid()};
     enum {energyEqSolidIdx = energyEq0Idx + numEnergyEqFluid + numEnergyEqSolid - 1};
     enum {wPhaseIdx = FluidSystem::wPhaseIdx};
     enum {nPhaseIdx = FluidSystem::nPhaseIdx};
@@ -159,13 +157,9 @@ class CombustionProblemOneComponent: public PorousMediumFlowProblem<TypeTag>
     enum {nCompIdx = FluidSystem::N2Idx};
 
     // formulations
-    enum {
-        pressureFormulation = GET_PROP_VALUE(TypeTag, PressureFormulation),
-        mostWettingFirst = MpNcPressureFormulation::mostWettingFirst,
-        leastWettingFirst = MpNcPressureFormulation::leastWettingFirst
-    };
-
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
+    static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
+    static constexpr auto mostWettingFirst = MpNcPressureFormulation::mostWettingFirst;
+    static constexpr auto leastWettingFirst = MpNcPressureFormulation::leastWettingFirst;
 
 public:
     CombustionProblemOneComponent(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
@@ -433,7 +427,8 @@ private:
             // For two phases this means that there is one pressure as primary variable: pn
             priVars[p0Idx] = p[nPhaseIdx];
         }
-        else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << pressureFormulation << " is invalid.");
+        else
+            DUNE_THROW(Dune::InvalidStateException, "CombustionProblemOneComponent does not support the chosen pressure formulation.");
 
         fluidState.setMoleFraction(wPhaseIdx, wCompIdx, 1.0);
         fluidState.setMoleFraction(wPhaseIdx, nCompIdx, 0.0);
@@ -454,10 +449,10 @@ private:
         using ComputeFromReferencePhase = ComputeFromReferencePhase<Scalar, FluidSystem>;
         ParameterCache paramCache;
         ComputeFromReferencePhase::solve(fluidState,
-                                        paramCache,
-                                        refPhaseIdx,
-                                        /*setViscosity=*/false,
-                                        /*setEnthalpy=*/false);
+                                         paramCache,
+                                         refPhaseIdx,
+                                         /*setViscosity=*/false,
+                                         /*setEnthalpy=*/false);
 
         //////////////////////////////////////
         // Set fugacities
@@ -494,9 +489,7 @@ private:
      * \brief Give back whether the tested position (input) is a specific region (right) in the domain
      */
     bool inPM_(const GlobalPosition & globalPos) const
-    {   return
-        not this->spatialParams().inOutFlow(globalPos);
-    }
+    { return !this->spatialParams().inOutFlow(globalPos); }
 
 private:
     static constexpr Scalar eps_ = 1e-6;
@@ -523,7 +516,6 @@ private:
 
     Scalar time_;
     std::shared_ptr<GridVariables> gridVariables_;
-
 };
 
 } //end namespace
diff --git a/test/porousmediumflow/mpnc/implicit/combustionspatialparams.hh b/test/porousmediumflow/mpnc/implicit/combustionspatialparams.hh
index 784adce694c6a38c8238a84b29405c65e595ef84..51f859a93ccb02609b788cd6ab04b8952503dc83 100644
--- a/test/porousmediumflow/mpnc/implicit/combustionspatialparams.hh
+++ b/test/porousmediumflow/mpnc/implicit/combustionspatialparams.hh
@@ -83,17 +83,18 @@ class CombustionSpatialParams : public FVSpatialParams<TypeTag>
     using Element = typename GridView::template Codim<0>::Entity;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
     enum {dimWorld = GridView::dimensionworld};
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
 public:
+    //! export the type used for the permeability
     using PermeabilityType = Scalar;
+    //! export the material law type used
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
 
-    CombustionSpatialParams(const Problem &problem)
-        : ParentType(problem)
+    CombustionSpatialParams(const Problem &problem) : ParentType(problem)
     {
         // this is the parameter value from file part
         porosity_ = getParam<Scalar>("SpatialParams.PorousMedium.porosity");
@@ -151,8 +152,7 @@ public:
                     const SubControlVolume &scv,
                     const ElementSolution &elemSol) const
     {
-        const auto& globalPos =  scv.dofPosition();
-        if ( inOutFlow(globalPos) )
+        if ( inOutFlow(scv.dofPosition()) )
             return porosityOutFlow_ ;
         else
             return porosity_ ;
@@ -161,10 +161,8 @@ public:
     /*!
      * \brief Return a reference to the material parameters of the material law.
      * \param globalPos The position in global coordinates. */
-    const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition & globalPos) const
-    {
-            return materialParams_ ;
-    }
+    const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition & globalPos) const
+    { return materialParams_ ; }
 
     /*!\brief Return the characteristic length for the mass transfer.
      *
@@ -178,10 +176,7 @@ public:
                                       const SubControlVolume &scv,
                                       const ElementSolution &elemSol) const
 
-    {
-        const auto& globalPos =  scv.center();
-        return characteristicLengthAtPos(globalPos);
-    }
+    { return characteristicLengthAtPos(scv.center()); }
 
 
     /*!\brief Return the characteristic length for the mass transfer.
@@ -200,18 +195,13 @@ public:
     const Scalar factorEnergyTransfer(const Element &element,
                                       const SubControlVolume &scv,
                                       const ElementSolution &elemSol) const
-    {
-       const auto& globalPos =  scv.dofPosition();
-        return factorEnergyTransferAtPos(globalPos);
-    }
+    { return factorEnergyTransferAtPos(scv.dofPosition()); }
 
 
     /*!\brief Return the pre factor the the energy transfer
      * \param globalPos The position in global coordinates.*/
     const Scalar factorEnergyTransferAtPos(const  GlobalPosition & globalPos) const
-    {
-        return factorEnergyTransfer_ ;
-    }
+    { return factorEnergyTransfer_; }
 
 
     /*!\brief Return the pre factor the the mass transfer
@@ -225,17 +215,12 @@ public:
     const Scalar factorMassTransfer(const Element &element,
                                     const SubControlVolume &scv,
                                     const ElementSolution &elemSol) const
-    {
-       const auto& globalPos =  scv.dofPosition();
-       return factorMassTransferAtPos(globalPos);
-    }
+    { return factorMassTransferAtPos(scv.dofPosition()); }
 
     /*!\brief Return the pre factor the the mass transfer
      * \param globalPos The position in global coordinates.*/
     const Scalar factorMassTransferAtPos(const  GlobalPosition & globalPos) const
-    {
-        return factorMassTransfer_ ;
-    }
+    { return factorMassTransfer_; }
 
 
     /*!
@@ -246,9 +231,7 @@ public:
      * \param globalPos The global position
      */
     Scalar solidHeatCapacityAtPos(const GlobalPosition& globalPos) const
-    {
-        return solidHeatCapacity_ ;// specific heat capacity of solid  [J / (kg K)]
-    }
+    { return solidHeatCapacity_; }
 
     /*!
      * \brief Returns the mass density \f$[kg / m^3]\f$ of the rock matrix.
@@ -258,9 +241,7 @@ public:
      * \param globalPos The global position
      */
     Scalar solidDensityAtPos(const GlobalPosition& globalPos) const
-    {
-        return solidDensity_ ;// density of solid [kg/m^3]
-    }
+    { return solidDensity_; }
 
     /*!
      * \brief Returns the thermal conductivity \f$\mathrm{[W/(m K)]}\f$ of the porous material.
@@ -274,34 +255,18 @@ public:
                                     const SubControlVolume &scv,
                                     const ElementSolution &elemSol) const
     {
-        const auto& globalPos =  scv.dofPosition();
-        if ( inOutFlow(globalPos) )
-            return solidThermalConductivityOutflow_ ;// conductivity of solid  [W / (m K ) ]
+        if ( inOutFlow(scv.dofPosition()) )
+            return solidThermalConductivityOutflow_ ;
         else
             return solidThermalConductivity_ ;
     }
 
-    /*!
-     * \brief Give back whether the tested position (input) is a specific region (right end of porous medium) in the domain
-     */
-    bool inOutFlow(const GlobalPosition & globalPos) const
-    { return globalPos[0] > (lengthPM_ - eps_) ;    }
-
-    /*!
-     * \brief Give back how long the porous medium domain is.
-     */
-    Scalar lengthPM() const
-    {
-        return lengthPM_ ;
-    }
-
-    /*!
-     * \brief Give back the itnerfacial tension
-     */
-    Scalar interfacialTension() const
-    {
-        return interfacialTension_ ;
-    }
+    //! Return if the tested position (input) is a specific region (right end of porous medium) in the domain
+    bool inOutFlow(const GlobalPosition & globalPos) const { return globalPos[0] > (lengthPM_ - eps_) ;    }
+    //! Return the length of the porous medium domain
+    Scalar lengthPM() const { return lengthPM_ ; }
+    //! Return the interfacial tension
+    Scalar interfacialTension() const { return interfacialTension_ ; }
 
 private:
     static constexpr Scalar eps_ = 1e-6;
@@ -312,7 +277,7 @@ private:
     Scalar factorEnergyTransfer_ ;
     Scalar factorMassTransfer_ ;
     Scalar characteristicLength_ ;
-    MaterialLawParams   materialParams_ ;
+    MaterialLawParams materialParams_ ;
 
     // Outflow Domain
     Scalar intrinsicPermeabilityOutFlow_ ;
diff --git a/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh b/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh
index 71167cf3c4996847b167617cac8d70499a508847..27892ae7002744c56770a933381c12552054b04e 100644
--- a/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh
+++ b/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh
@@ -39,10 +39,10 @@
 // setting it here, because it impacts volume variables and spatialparameters
 #define USE_PCMAX 1
 
-#include <dune/common/parametertreeparser.hh>
-
 #include <dumux/discretization/box/properties.hh>
+
 #include <dumux/porousmediumflow/mpnc/model.hh>
+#include <dumux/porousmediumflow/mpnc/pressureformulation.hh>
 #include <dumux/porousmediumflow/problem.hh>
 
 #include <dumux/material/fluidsystems/h2on2kinetic.hh>
@@ -82,9 +82,11 @@ SET_TYPE_PROP(EvaporationAtmosphereTypeTag,
               FluidSystems::H2ON2Kinetic<typename GET_PROP_TYPE(TypeTag, Scalar), /*useComplexRelations=*/false>);
 
 //! Set the default pressure formulation: either pw first or pn first
-SET_INT_PROP(EvaporationAtmosphereTypeTag,
-             PressureFormulation,
-             MpNcPressureFormulation::leastWettingFirst);
+SET_PROP(EvaporationAtmosphereTypeTag, PressureFormulation)
+{
+public:
+    static const MpNcPressureFormulation value = MpNcPressureFormulation::leastWettingFirst;
+};
 
 // Set the type used for scalar values
 SET_TYPE_PROP(EvaporationAtmosphereTypeTag, Scalar, double);
@@ -101,7 +103,6 @@ class EvaporationAtmosphereProblem: public PorousMediumFlowProblem<TypeTag>
 {
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
@@ -112,37 +113,38 @@ class EvaporationAtmosphereProblem: public PorousMediumFlowProblem<TypeTag>
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
     using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
     using ParameterCache = typename FluidSystem::ParameterCache;
     using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
+
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
     enum { dimWorld = GridView::dimensionworld };
-    enum { numPhases       = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() };
-    enum { numComponents   = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents() };
+    enum { numPhases       = ModelTraits::numPhases() };
+    enum { numComponents   = ModelTraits::numComponents() };
     enum { s0Idx = Indices::s0Idx };
     enum { p0Idx = Indices::p0Idx };
     enum { conti00EqIdx    = Indices::conti0EqIdx };
     enum { energyEq0Idx    = Indices::energyEqIdx };
-    enum { wPhaseIdx       = FluidSystem::wPhaseIdx };
-    enum { nPhaseIdx       = FluidSystem::nPhaseIdx };
+    enum { liquidPhaseIdx       = FluidSystem::liquidPhaseIdx };
+    enum { gasPhaseIdx       = FluidSystem::gasPhaseIdx };
     enum { wCompIdx        = FluidSystem::H2OIdx };
     enum { nCompIdx        = FluidSystem::N2Idx };
-    enum { numEnergyEqFluid = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid) };
-    enum { numEnergyEqSolid = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid) };
+    enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() };
+    enum { numEnergyEqSolid = ModelTraits::numEnergyEqSolid() };
 
     static constexpr bool enableChemicalNonEquilibrium = GET_PROP_VALUE(TypeTag, EnableChemicalNonEquilibrium);
     using ConstraintSolver = MiscibleMultiPhaseComposition<Scalar, FluidSystem>;
 
     // formulations
-    enum {
-        pressureFormulation = GET_PROP_VALUE(TypeTag, PressureFormulation),
-        mostWettingFirst    = MpNcPressureFormulation::mostWettingFirst,
-        leastWettingFirst   = MpNcPressureFormulation::leastWettingFirst
-    };
-
-   using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
+    static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
+    static constexpr auto mostWettingFirst = MpNcPressureFormulation::mostWettingFirst;
+    static constexpr auto leastWettingFirst = MpNcPressureFormulation::leastWettingFirst;
 
 public:
     /*!
@@ -266,8 +268,8 @@ public:
             fluidState.setPressure(phaseIdx, pnInitial_);
         }
 
-        fluidState.setTemperature(nPhaseIdx, TInject_ );
-        fluidState.setTemperature(wPhaseIdx, TInitial_ ); // this value is a good one, TInject does not work
+        fluidState.setTemperature(gasPhaseIdx, TInject_ );
+        fluidState.setTemperature(liquidPhaseIdx, TInitial_ ); // this value is a good one, TInject does not work
 
         // This solves the system of equations defining x=x(p,T)
         ConstraintSolver::solve(fluidState,
@@ -276,14 +278,14 @@ public:
                                 /*setEnthalpy=*/false) ;
 
         // Now let's make the air phase less than fully saturated with water
-        fluidState.setMoleFraction(nPhaseIdx, wCompIdx, fluidState.moleFraction(nPhaseIdx, wCompIdx)*percentOfEquil_ ) ;
-        fluidState.setMoleFraction(nPhaseIdx, nCompIdx, 1.-fluidState.moleFraction(nPhaseIdx, wCompIdx) ) ;
+        fluidState.setMoleFraction(gasPhaseIdx, wCompIdx, fluidState.moleFraction(gasPhaseIdx, wCompIdx)*percentOfEquil_ ) ;
+        fluidState.setMoleFraction(gasPhaseIdx, nCompIdx, 1.-fluidState.moleFraction(gasPhaseIdx, wCompIdx) ) ;
 
         // compute density of injection phase
         const Scalar density = FluidSystem::density(fluidState,
                                                      dummyCache,
-                                                     nPhaseIdx);
-        fluidState.setDensity(nPhaseIdx, density);
+                                                     gasPhaseIdx);
+        fluidState.setDensity(gasPhaseIdx, density);
 
         for(int phaseIdx=0; phaseIdx<numPhases; phaseIdx++)
         {
@@ -293,18 +295,18 @@ public:
                 fluidState.setEnthalpy(phaseIdx, h);
         }
 
-        const Scalar molarFlux = massFluxInjectedPhase / fluidState.averageMolarMass(nPhaseIdx);
+        const Scalar molarFlux = massFluxInjectedPhase / fluidState.averageMolarMass(gasPhaseIdx);
 
         // actually setting the fluxes
         if (onLeftBoundary_(globalPos) && this->spatialParams().inFF_(globalPos))
         {
-            values[conti00EqIdx + nPhaseIdx * numComponents + wCompIdx]
-             = -molarFlux * fluidState.moleFraction(nPhaseIdx, wCompIdx);
-            values[conti00EqIdx + nPhaseIdx * numComponents + nCompIdx]
-             = -molarFlux * fluidState.moleFraction(nPhaseIdx, nCompIdx);
+            values[conti00EqIdx + gasPhaseIdx * numComponents + wCompIdx]
+             = -molarFlux * fluidState.moleFraction(gasPhaseIdx, wCompIdx);
+            values[conti00EqIdx + gasPhaseIdx * numComponents + nCompIdx]
+             = -molarFlux * fluidState.moleFraction(gasPhaseIdx, nCompIdx);
             // energy equations are specified mass specifically
-            values[energyEq0Idx + nPhaseIdx] = - massFluxInjectedPhase
-                                                    * fluidState.enthalpy(nPhaseIdx) ;
+            values[energyEq0Idx + gasPhaseIdx] = - massFluxInjectedPhase
+                                                    * fluidState.enthalpy(gasPhaseIdx) ;
         }
         return values;
     }
@@ -357,12 +359,12 @@ private:
         Scalar S[numPhases];
 
         if (this->spatialParams().inPM_(globalPos)){
-            S[wPhaseIdx]    = SwPMInitial_;
-            S[nPhaseIdx]    = 1. - S[wPhaseIdx] ;
+            S[liquidPhaseIdx]    = SwPMInitial_;
+            S[gasPhaseIdx]    = 1. - S[liquidPhaseIdx] ;
         }
         else if (this->spatialParams().inFF_(globalPos)){
-            S[wPhaseIdx]    = SwFFInitial_;
-            S[nPhaseIdx]    = 1. - S[wPhaseIdx] ;
+            S[liquidPhaseIdx]    = SwFFInitial_;
+            S[gasPhaseIdx]    = 1. - S[liquidPhaseIdx] ;
         }
         else
             DUNE_THROW(Dune::InvalidStateException,
@@ -392,12 +394,12 @@ private:
         if (this->spatialParams().inPM_(globalPos)){
             // Use homogenous pressure in the domain and let the newton find the pressure distribution
             using std::abs;
-            p[wPhaseIdx] = pnInitial_  - abs(capPress[wPhaseIdx]);
-            p[nPhaseIdx] = p[wPhaseIdx] + abs(capPress[wPhaseIdx]);
+            p[liquidPhaseIdx] = pnInitial_  - abs(capPress[liquidPhaseIdx]);
+            p[gasPhaseIdx] = p[liquidPhaseIdx] + abs(capPress[liquidPhaseIdx]);
         }
         else if (this->spatialParams().inFF_(globalPos)){
-            p[nPhaseIdx] = pnInitial_ ;
-            p[wPhaseIdx] = pnInitial_  ;
+            p[gasPhaseIdx] = pnInitial_ ;
+            p[liquidPhaseIdx] = pnInitial_  ;
         }
         else
             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
@@ -405,14 +407,14 @@ private:
         if(pressureFormulation == mostWettingFirst){
             // This means that the pressures are sorted from the most wetting to the least wetting-1 in the primary variables vector.
             // For two phases this means that there is one pressure as primary variable: pw
-            priVars[p0Idx] = p[wPhaseIdx];
+            priVars[p0Idx] = p[liquidPhaseIdx];
         }
         else if(pressureFormulation == leastWettingFirst){
             // This means that the pressures are sorted from the least wetting to the most wetting-1 in the primary variables vector.
             // For two phases this means that there is one pressure as primary variable: pn
-            priVars[p0Idx] = p[nPhaseIdx];
+            priVars[p0Idx] = p[gasPhaseIdx];
         }
-        else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << pressureFormulation << " is invalid.");
+        else DUNE_THROW(Dune::InvalidStateException, "EvaporationAtmosphereProblem does not support the chosen pressure formulation.");
 
         for (int energyEqIdx=0; energyEqIdx< numEnergyEqFluid+numEnergyEqSolid; ++energyEqIdx)
                 priVars[energyEq0Idx + energyEqIdx] = T;
@@ -429,8 +431,8 @@ private:
 
         FluidState dryFluidState(equilibriumFluidState);
         // Now let's make the air phase less than fully saturated with vapor
-        dryFluidState.setMoleFraction(nPhaseIdx, wCompIdx, dryFluidState.moleFraction(nPhaseIdx, wCompIdx) * percentOfEquil_ ) ;
-        dryFluidState.setMoleFraction(nPhaseIdx, nCompIdx, 1.0-dryFluidState.moleFraction(nPhaseIdx, wCompIdx) ) ;
+        dryFluidState.setMoleFraction(gasPhaseIdx, wCompIdx, dryFluidState.moleFraction(gasPhaseIdx, wCompIdx) * percentOfEquil_ ) ;
+        dryFluidState.setMoleFraction(gasPhaseIdx, nCompIdx, 1.0-dryFluidState.moleFraction(gasPhaseIdx, wCompIdx) ) ;
 
         /* Difference between kinetic and MPNC:
          * number of component related primVar and how they are calculated (mole fraction, fugacities, resp.)
@@ -456,7 +458,7 @@ private:
         {
             // in the case I am using the "standard" mpnc model, the variables to be set are the "fugacities"
             const Scalar fugH2O = FluidSystem::H2O::vaporPressure(T) ;
-            const Scalar fugN2 = p[nPhaseIdx] - fugH2O ;
+            const Scalar fugN2 = p[gasPhaseIdx] - fugH2O ;
 
             priVars[conti00EqIdx + FluidSystem::N2Idx] = fugN2 ;
             priVars[conti00EqIdx + FluidSystem::H2OIdx] = fugH2O ;
@@ -466,8 +468,8 @@ private:
 
             const Scalar Henry              = BinaryCoeff::H2O_N2::henry(TInitial_);
             const Scalar satVapPressure     = FluidSystem::H2O::vaporPressure(TInitial_);
-            xl[FluidSystem::H2OIdx]         = x_[wPhaseIdx][wCompIdx];
-            xl[FluidSystem::N2Idx]          = x_[wPhaseIdx][nCompIdx];
+            xl[FluidSystem::H2OIdx]         = x_[liquidPhaseIdx][wCompIdx];
+            xl[FluidSystem::N2Idx]          = x_[liquidPhaseIdx][nCompIdx];
             beta[FluidSystem::H2OIdx]       = satVapPressure ;
             beta[FluidSystem::N2Idx]        = Henry ;
 
diff --git a/test/porousmediumflow/mpnc/implicit/evaporationatmospherespatialparams.hh b/test/porousmediumflow/mpnc/implicit/evaporationatmospherespatialparams.hh
index bdc6321968fb1af748f91b6205a7a8ab9468872a..39700dcf967ba903fb29d12e677739eac1cf884f 100644
--- a/test/porousmediumflow/mpnc/implicit/evaporationatmospherespatialparams.hh
+++ b/test/porousmediumflow/mpnc/implicit/evaporationatmospherespatialparams.hh
@@ -67,7 +67,7 @@ SET_TYPE_PROP(EvaporationAtmosphereSpatialParams, SpatialParams, EvaporationAtmo
 SET_PROP(EvaporationAtmosphereSpatialParams, MaterialLaw)
 {
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    enum {wPhaseIdx   = FluidSystem::wPhaseIdx};
+    enum {liquidPhaseIdx   = FluidSystem::liquidPhaseIdx};
 
 private:
     // define the material law which is parameterized by effective
@@ -103,7 +103,7 @@ private:
 
     using TwoPMaterialLaw = EffToAbsLaw<EffectiveLaw>;
     public:
-        using type = TwoPAdapter<wPhaseIdx, TwoPMaterialLaw>;
+        using type = TwoPAdapter<liquidPhaseIdx, TwoPMaterialLaw>;
 };
 
 
@@ -155,30 +155,33 @@ class EvaporationAtmosphereSpatialParams : public FVSpatialParams<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
+    using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
     enum { dimWorld = GridView::dimensionworld };
     enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() };
 
-    using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
     using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState);
 
 public:
-
+    //! export the type used for the permeability
+    using PermeabilityType = Scalar;
+    //! export the material law type used
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    //! export the types used for interfacial area calculations
     using AwnSurface = typename GET_PROP_TYPE(TypeTag, AwnSurface);
-    using AwnSurfaceParams = typename  AwnSurface::Params;
     using AwsSurface = typename GET_PROP_TYPE(TypeTag, AwsSurface);
-    using AwsSurfaceParams = typename  AwsSurface::Params;
     using AnsSurface = typename GET_PROP_TYPE(TypeTag, AnsSurface);
-    using AnsSurfaceParams = typename  AnsSurface::Params;
-    using PermeabilityType = Scalar;
 
-    EvaporationAtmosphereSpatialParams(const Problem &problem)
-        : ParentType(problem)
+    //! convenience aliases of the law parameters
+    using MaterialLawParams = typename MaterialLaw::Params;
+    using AwnSurfaceParams = typename AwnSurface::Params;
+    using AwsSurfaceParams = typename AwsSurface::Params;
+    using AnsSurfaceParams = typename AnsSurface::Params;
+
+    EvaporationAtmosphereSpatialParams(const Problem &problem) : ParentType(problem)
     {
         heightPM_               = getParam<std::vector<Scalar>>("Grid.Positions1")[1];
         heightDomain_           = getParam<std::vector<Scalar>>("Grid.Positions1")[2];
@@ -231,8 +234,7 @@ public:
             // capillary pressure parameters
             FluidState fluidState ;
             Scalar S[numPhases] ;
-            const auto &materialParams =  materialParamsPM_;
-                    Scalar capPress[numPhases];
+            Scalar capPress[numPhases];
             //set saturation to inital values, this needs to be done in order for the fluidState to tell me pc
             for (int phaseIdx = 0; phaseIdx < numPhases ; ++phaseIdx) {
                 // set saturation to zero for getting pcmax
@@ -243,7 +245,7 @@ public:
             }
 
             //obtain pc according to saturation
-            MaterialLaw::capillaryPressures(capPress, materialParams, fluidState);
+            MaterialLaw::capillaryPressures(capPress, materialParamsPM_, fluidState);
             using std::abs;
             pcMax_ = abs(capPress[0]);
 
@@ -278,8 +280,8 @@ public:
                                   const SubControlVolume& scv,
                                   const ElementSolution& elemSol) const
     {
-        const  auto & globalPos =  scv.dofPosition();
-        if (inFF_(globalPos) )
+        const  auto & globalPos = scv.dofPosition();
+        if (inFF_(globalPos))
             return intrinsicPermeabilityFF_ ;
         else if (inPM_(globalPos))
             return intrinsicPermeabilityPM_ ;
@@ -301,7 +303,7 @@ public:
     {
         const auto& globalPos =  scv.dofPosition();
 
-        if (inFF_(globalPos) )
+        if (inFF_(globalPos))
             return porosityFF_ ;
         else if (inPM_(globalPos))
             return porosityPM_ ;
@@ -313,25 +315,15 @@ public:
     const MaterialLawParams& materialLawParams(const Element& element,
                                                const SubControlVolume& scv,
                                                const ElementSolution& elemSol) const
-    {
-        const auto& globalPos =  scv.dofPosition();
-        if (inFF_(globalPos) )
-            return materialParamsFF_ ;
-        else if (inPM_(globalPos))
-            return materialParamsPM_ ;
-        else             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
-    }
+    { return materialLawParamsAtPos(scv.dofPosition()); }
 
-    /*!
-     * \brief Return a reference to the material parameters of the material law.
-     * \param globalPos The position in global coordinates. */
-    const MaterialLawParams & materialLawParamsAtPos(const GlobalPosition & globalPos) const
+    const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
     {
-        if (inFF_(globalPos) )
-            return materialParamsFF_ ;
+        if (inFF_(globalPos))
+            return materialParamsFF_;
         else if (inPM_(globalPos))
-            return materialParamsPM_ ;
-        else             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
+            return materialParamsPM_;
+        else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
     }
 
     /*!\brief Return a reference to the container object for the
@@ -343,16 +335,16 @@ public:
      * \param fvGeometry  The finite volume geometry
      * \param scvIdx      The local index of the sub-control volume */
     template<class ElementSolution>
-    const AwnSurfaceParams & aWettingNonWettingSurfaceParams(const Element &element,
-                                                             const SubControlVolume &scv,
-                                                             const ElementSolution &elemSol) const
+    const AwnSurfaceParams& aWettingNonWettingSurfaceParams(const Element &element,
+                                                            const SubControlVolume &scv,
+                                                            const ElementSolution &elemSol) const
     {
         const auto& globalPos =  scv.dofPosition();
         if (inFF_(globalPos) )
             return aWettingNonWettingSurfaceParamsFreeFlow_  ;
         else if (inPM_(globalPos))
             return aWettingNonWettingSurfaceParams_ ;
-        else             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
+        else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
      }
 
     /*!\brief Return a reference to the container object for the
@@ -364,16 +356,16 @@ public:
      * \param fvGeometry  The finite volume geometry
      * \param scvIdx      The local index of the sub-control volume */
     template<class ElementSolution>
-    const AnsSurfaceParams & aNonWettingSolidSurfaceParams(const Element &element,
-                                                             const SubControlVolume &scv,
-                                                             const ElementSolution &elemSol) const
+    const AnsSurfaceParams& aNonWettingSolidSurfaceParams(const Element &element,
+                                                          const SubControlVolume &scv,
+                                                          const ElementSolution &elemSol) const
     {
         const auto& globalPos =  scv.dofPosition();
         if (inFF_(globalPos) )
             return aNonWettingSolidSurfaceParamsFreeFlow_  ;
         else if (inPM_(globalPos))
             return aNonWettingSolidSurfaceParams_ ;
-        else             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
+        else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
      }
 
     /*!\brief Return the maximum capillary pressure for the given pc-Sw curve
@@ -407,10 +399,7 @@ public:
                                       const SubControlVolume &scv,
                                       const ElementSolution &elemSol) const
 
-    {
-        const auto& globalPos =  scv.dofPosition();
-        return characteristicLengthAtPos(globalPos);
-    }
+    { return characteristicLengthAtPos(scv.dofPosition()); }
 
     /*!\brief Return the characteristic length for the mass transfer.
      * \param globalPos The position in global coordinates.*/
@@ -420,7 +409,7 @@ public:
             return characteristicLengthFF_ ;
         else if (inPM_(globalPos))
             return characteristicLengthPM_ ;
-        else             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
+        else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
     }
 
     /*!\brief Return the pre factor the the energy transfer
@@ -434,10 +423,7 @@ public:
     const Scalar factorEnergyTransfer(const Element &element,
                                       const SubControlVolume &scv,
                                       const ElementSolution &elemSol) const
-    {
-       const auto& globalPos =  scv.dofPosition();
-       return factorEnergyTransferAtPos(globalPos);
-    }
+    { return factorEnergyTransferAtPos(scv.dofPosition()); }
 
     /*!\brief Return the pre factor the the energy transfer
      * \param globalPos The position in global coordinates.*/
@@ -447,7 +433,7 @@ public:
             return factorEnergyTransfer_ ;
         else if (inPM_(globalPos))
             return factorEnergyTransfer_ ;
-        else             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
+        else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
     }
 
     /*!\brief Return the pre factor the the mass transfer
@@ -461,11 +447,7 @@ public:
     const Scalar factorMassTransfer(const Element &element,
                                       const SubControlVolume &scv,
                                       const ElementSolution &elemSol) const
-    {
-       const auto& globalPos =  scv.dofPosition();
-        return factorMassTransferAtPos(globalPos);
-
-    }
+    { return factorMassTransferAtPos(scv.dofPosition()); }
 
     /*!\brief Return the pre factor the the mass transfer
      * \param globalPos The position in global coordinates.*/
@@ -475,7 +457,7 @@ public:
             return factorMassTransfer_ ;
         else if (inPM_(globalPos))
             return factorMassTransfer_ ;
-        else             DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
+        else DUNE_THROW(Dune::InvalidStateException, "You should not be here: x=" << globalPos[0] << " y= "<< globalPos[dimWorld-1]);
     }
 
 
@@ -544,11 +526,10 @@ private:
     static constexpr Scalar eps_  = 1e-6;
     Scalar heightDomain_ ;
 
-    AwnSurfaceParams    aWettingNonWettingSurfaceParams_;
-    AnsSurfaceParams    aNonWettingSolidSurfaceParams_ ;
-
-    AwnSurfaceParams    aWettingNonWettingSurfaceParamsFreeFlow_;
-    AnsSurfaceParams    aNonWettingSolidSurfaceParamsFreeFlow_ ;
+    AwnSurfaceParams aWettingNonWettingSurfaceParams_;
+    AnsSurfaceParams aNonWettingSolidSurfaceParams_ ;
+    AwnSurfaceParams aWettingNonWettingSurfaceParamsFreeFlow_;
+    AnsSurfaceParams aNonWettingSolidSurfaceParamsFreeFlow_ ;
 
     Scalar pcMax_ ;
 
@@ -559,13 +540,13 @@ private:
     Scalar factorEnergyTransfer_ ;
     Scalar factorMassTransfer_ ;
     Scalar characteristicLengthPM_ ;
-    MaterialLawParams   materialParamsPM_ ;
+    MaterialLawParams materialParamsPM_ ;
 
     // Free Flow Domain
     Scalar porosityFF_ ;
     Scalar intrinsicPermeabilityFF_ ;
     Scalar characteristicLengthFF_ ;
-    MaterialLawParams   materialParamsFF_ ;
+    MaterialLawParams materialParamsFF_ ;
 
     // solid parameters
     Scalar solidDensity_ ;
diff --git a/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh b/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh
index aa53c388c3264178511501384ba80174267f62c9..b235977db2b0a0f4f3ddff51a474490006aff3cd 100644
--- a/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh
+++ b/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh
@@ -109,7 +109,6 @@ class ObstacleProblem
 {
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
@@ -125,16 +124,19 @@ class ObstacleProblem
     using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
     using ParameterCache = typename FluidSystem::ParameterCache;
 
-    enum {dimWorld = GridView::dimensionworld};
-    enum {numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()};
-    enum {numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()};
-    enum {nPhaseIdx = FluidSystem::nPhaseIdx};
-    enum {wPhaseIdx = FluidSystem::wPhaseIdx};
-    enum {wCompIdx = FluidSystem::wCompIdx};
-    enum {nCompIdx = FluidSystem::nCompIdx};
-    enum {fug0Idx = Indices::fug0Idx};
-    enum {s0Idx = Indices::s0Idx};
-    enum {p0Idx = Indices::p0Idx};
+    using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
+    using Indices = typename ModelTraits::Indices;
+
+    enum { dimWorld = GridView::dimensionworld };
+    enum { numPhases = ModelTraits::numPhases() };
+    enum { numComponents = ModelTraits::numComponents() };
+    enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
+    enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
+    enum { H2OIdx = FluidSystem::H2OIdx };
+    enum { N2Idx = FluidSystem::N2Idx };
+    enum { fug0Idx = Indices::fug0Idx };
+    enum { s0Idx = Indices::s0Idx };
+    enum { p0Idx = Indices::p0Idx };
 
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
     using PhaseVector = Dune::FieldVector<Scalar, numPhases>;
@@ -308,33 +310,33 @@ private:
         if (onInlet_(globalPos))
         {
             // only liquid on inlet
-            refPhaseIdx = wPhaseIdx;
-            otherPhaseIdx = nPhaseIdx;
+            refPhaseIdx = liquidPhaseIdx;
+            otherPhaseIdx = gasPhaseIdx;
 
             // set liquid saturation
-            fs.setSaturation(wPhaseIdx, 1.0);
+            fs.setSaturation(liquidPhaseIdx, 1.0);
 
             // set pressure of the liquid phase
-            fs.setPressure(wPhaseIdx, 2e5);
+            fs.setPressure(liquidPhaseIdx, 2e5);
 
             // set the liquid composition to pure water
-            fs.setMoleFraction(wPhaseIdx, nCompIdx, 0.0);
-            fs.setMoleFraction(wPhaseIdx, wCompIdx, 1.0);
+            fs.setMoleFraction(liquidPhaseIdx, N2Idx, 0.0);
+            fs.setMoleFraction(liquidPhaseIdx, H2OIdx, 1.0);
         }
         else {
             // elsewhere, only gas
-            refPhaseIdx = nPhaseIdx;
-            otherPhaseIdx = wPhaseIdx;
+            refPhaseIdx = gasPhaseIdx;
+            otherPhaseIdx = liquidPhaseIdx;
 
             // set gas saturation
-            fs.setSaturation(nPhaseIdx, 1.0);
+            fs.setSaturation(gasPhaseIdx, 1.0);
 
             // set pressure of the gas phase
-            fs.setPressure(nPhaseIdx, 1e5);
+            fs.setPressure(gasPhaseIdx, 1e5);
 
             // set the gas composition to 99% nitrogen and 1% steam
-            fs.setMoleFraction(nPhaseIdx, nCompIdx, 0.99);
-            fs.setMoleFraction(nPhaseIdx, wCompIdx, 0.01);
+            fs.setMoleFraction(gasPhaseIdx, N2Idx, 0.99);
+            fs.setMoleFraction(gasPhaseIdx, H2OIdx, 0.01);
         }
 
         // set the other saturation
diff --git a/test/porousmediumflow/mpnc/implicit/obstaclespatialparams.hh b/test/porousmediumflow/mpnc/implicit/obstaclespatialparams.hh
index 7cdb5b6e26f6562064522851c7368301f7d7d7de..f628bd11b9dee3387f731c5147efca0cb4f0e8bd 100644
--- a/test/porousmediumflow/mpnc/implicit/obstaclespatialparams.hh
+++ b/test/porousmediumflow/mpnc/implicit/obstaclespatialparams.hh
@@ -55,13 +55,13 @@ SET_PROP(ObstacleSpatialParams, MaterialLaw)
 {
 private:
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    enum {wPhaseIdx = FluidSystem::wPhaseIdx};
+    enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
     // define the material law
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using EffMaterialLaw = RegularizedLinearMaterial<Scalar>;
     using TwoPMaterialLaw = EffToAbsLaw<EffMaterialLaw>;
 public:
-    using type = TwoPAdapter<wPhaseIdx, TwoPMaterialLaw>;
+    using type = TwoPAdapter<liquidPhaseIdx, TwoPMaterialLaw>;
 };
 }
 
@@ -81,18 +81,19 @@ class ObstacleSpatialParams : public FVSpatialParams<TypeTag>
     using Element = typename GridView::template Codim<0>::Entity;
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
+    using MaterialLawParams = typename GET_PROP_TYPE(TypeTag, MaterialLaw)::Params;
 
     enum {dimWorld=GridView::dimensionworld};
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
 
 public:
-     using PermeabilityType = Scalar;
-
+    //! export the type used for the permeability
+    using PermeabilityType = Scalar;
+    //! export the material law type used
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
 
-    ObstacleSpatialParams(const Problem &problem)
-        : ParentType(problem)
+    //! the constructor
+    ObstacleSpatialParams(const Problem &problem) : ParentType(problem)
     {
         // intrinsic permeabilities
         coarseK_ = 1e-12;
@@ -141,9 +142,7 @@ public:
     Scalar porosity(const Element &element,
                     const SubControlVolume &scv,
                     const ElementSolution &elemSol) const
-    {
-        return porosity_;
-    }
+    { return porosity_; }
 
     /*!
      * \brief Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw, etc.).
diff --git a/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh b/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh
index 017c3858ea9adcb8874bc1594c1db0bf26c7bdc7..6181baa6e8e150a0eece62135b81e699d414172b 100644
--- a/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh
+++ b/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh
@@ -93,7 +93,7 @@ class RichardsAnalyticalProblem :  public PorousMediumFlowProblem<TypeTag>
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     enum {
diff --git a/test/porousmediumflow/richards/implicit/richardsanalyticalspatialparams.hh b/test/porousmediumflow/richards/implicit/richardsanalyticalspatialparams.hh
index 710a17e729b791166df230dd438c321c6d378cb1..74cb15d260e1eaab99935f7af7fe3c56c70b08f0 100644
--- a/test/porousmediumflow/richards/implicit/richardsanalyticalspatialparams.hh
+++ b/test/porousmediumflow/richards/implicit/richardsanalyticalspatialparams.hh
@@ -78,11 +78,11 @@ class RichardsAnalyticalSpatialParams : public FVSpatialParams<TypeTag>
     enum { dimWorld=GridView::dimensionworld };
 
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
 public:
 
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
     // export permeability type
     using PermeabilityType = Scalar;
 
diff --git a/test/porousmediumflow/richards/implicit/richardslensproblem.hh b/test/porousmediumflow/richards/implicit/richardslensproblem.hh
index 057c4460b0ccd37eb8b44ba5f345cff6750e987e..029ad4f10c463fa4b2cd7f3e8f480c0e95acc126 100644
--- a/test/porousmediumflow/richards/implicit/richardslensproblem.hh
+++ b/test/porousmediumflow/richards/implicit/richardslensproblem.hh
@@ -99,7 +99,7 @@ class RichardsLensProblem : public PorousMediumFlowProblem<TypeTag>
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     enum {
         // copy some indices for convenience
diff --git a/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh b/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh
index 33f6292e5de5a3471199fac2d416fc38399f9f56..ac9eb428b2caa2980c5ec12f2a3237afa5d4ccb5 100644
--- a/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh
+++ b/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh
@@ -77,10 +77,10 @@ class RichardsLensSpatialParams : public FVSpatialParams<TypeTag>
     enum { dimWorld=GridView::dimensionworld };
 
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
 public:
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
     // export permeability type
     using PermeabilityType = Scalar;
 
@@ -173,4 +173,3 @@ private:
 } // end namespace Dumux
 
 #endif
-
diff --git a/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh b/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh
index 6e4cece020a8a0990e6ba793927b71acc95978cd..b4c032237583cb55866e271ed79709e46a5d6302 100644
--- a/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh
+++ b/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh
@@ -108,13 +108,13 @@ class RichardsNIConductionProblem :public PorousMediumFlowProblem<TypeTag>
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using IapwsH2O = Components::H2O<Scalar>;
 
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum { dimWorld = GridView::dimensionworld };
 
     enum {
         pressureIdx = Indices::pressureIdx,
-        wPhaseOnly = Indices::wPhaseOnly,
-        wPhaseIdx = Indices::wPhaseIdx,
+        liquidPhaseOnly = Indices::liquidPhaseOnly,
+        liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
         temperatureIdx = Indices::temperatureIdx
     };
 
@@ -161,7 +161,7 @@ public:
         volVars.update(someElemSol, *this, someElement, someScv);
 
         const auto porosity = this->spatialParams().porosity(someElement, someScv, someElemSol);
-        const auto densityW = volVars.density(wPhaseIdx);
+        const auto densityW = volVars.density(liquidPhaseIdx);
         const auto heatCapacityW = IapwsH2O::liquidHeatCapacity(someInitSol[temperatureIdx], someInitSol[pressureIdx]);
         const auto densityS = this->spatialParams().solidDensity(someElement, someScv, someElemSol);
         const auto heatCapacityS = this->spatialParams().solidHeatCapacity(someElement, someScv, someElemSol);
@@ -305,7 +305,7 @@ private:
     PrimaryVariables initial_(const GlobalPosition &globalPos) const
     {
         PrimaryVariables priVars(0.0);
-        priVars.setState(wPhaseOnly);
+        priVars.setState(liquidPhaseOnly);
         priVars[pressureIdx] = 1e5; // initial condition for the pressure
 
         priVars[temperatureIdx] = 290.;
diff --git a/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh b/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh
index 2c50d966b4cc296b803eb894b876ec9e0c9b9a69..7721e0ad3086b63c40f451f247e2475a55aced1c 100644
--- a/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh
+++ b/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh
@@ -117,13 +117,13 @@ class RichardsNIConvectionProblem : public PorousMediumFlowProblem<TypeTag>
     using IapwsH2O = Components::H2O<Scalar>;
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum { dimWorld = GridView::dimensionworld };
 
     enum {
         pressureIdx = Indices::pressureIdx,
-        wPhaseOnly = Indices::wPhaseOnly,
-        wPhaseIdx = Indices::wPhaseIdx,
+        liquidPhaseOnly = Indices::liquidPhaseOnly,
+        liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
         temperatureIdx = Indices::temperatureIdx
     };
 
@@ -175,7 +175,7 @@ public:
         volVars.update(someElemSol, *this, someElement, someScv);
 
         const auto porosity = this->spatialParams().porosity(someElement, someScv, someElemSol);
-        const auto densityW = volVars.density(wPhaseIdx);
+        const auto densityW = volVars.density(liquidPhaseIdx);
         const auto heatCapacityW = IapwsH2O::liquidHeatCapacity(someInitSol[temperatureIdx], someInitSol[pressureIdx]);
         const auto densityS = this->spatialParams().solidDensity(someElement, someScv, someElemSol);
         const auto heatCapacityS = this->spatialParams().solidHeatCapacity(someElement, someScv, someElemSol);
@@ -277,9 +277,9 @@ public:
 
         if(globalPos[0] < eps_)
         {
-            values[pressureIdx] = -darcyVelocity_*elemVolVars[scvf.insideScvIdx()].density(wPhaseIdx);
-            values[temperatureIdx] = -darcyVelocity_*elemVolVars[scvf.insideScvIdx()].density(wPhaseIdx)
-                                     *IapwsH2O::liquidEnthalpy(temperatureHigh_, elemVolVars[scvf.insideScvIdx()].pressure(wPhaseIdx));
+            values[pressureIdx] = -darcyVelocity_*elemVolVars[scvf.insideScvIdx()].density(liquidPhaseIdx);
+            values[temperatureIdx] = -darcyVelocity_*elemVolVars[scvf.insideScvIdx()].density(liquidPhaseIdx)
+                                     *IapwsH2O::liquidEnthalpy(temperatureHigh_, elemVolVars[scvf.insideScvIdx()].pressure(liquidPhaseIdx));
         }
         return values;
     }
@@ -327,7 +327,7 @@ private:
     PrimaryVariables initial_(const GlobalPosition &globalPos) const
     {
         PrimaryVariables priVars(0.0);
-        priVars.setState(wPhaseOnly);
+        priVars.setState(liquidPhaseOnly);
         priVars[pressureIdx] = pressureLow_; // initial condition for the pressure
         priVars[temperatureIdx] = temperatureLow_;
         return priVars;
diff --git a/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh b/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh
index 55d931966b2335c9981f84b1dca8e5109ffab05a..fff94fdd65b1a26fc7f73d264c1a70d35f636e02 100644
--- a/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh
+++ b/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh
@@ -104,7 +104,7 @@ class RichardsNIEvaporationProblem : public PorousMediumFlowProblem<TypeTag>
     using IapwsH2O = Components::H2O<Scalar>;
 
     // copy some indices for convenience
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum { dimWorld = GridView::dimensionworld };
 
     enum {
@@ -208,8 +208,8 @@ public:
         if(globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_)
         {
              values[conti0EqIdx] = 1e-3;
-             values[energyEqIdx] = FluidSystem::enthalpy( volVars.fluidState(),Indices::nPhaseIdx) * values[conti0EqIdx];
-             values[energyEqIdx] += FluidSystem::thermalConductivity(volVars.fluidState(), Indices::nPhaseIdx)
+             values[energyEqIdx] = FluidSystem::enthalpy( volVars.fluidState(), FluidSystem::gasPhaseIdx) * values[conti0EqIdx];
+             values[energyEqIdx] += FluidSystem::thermalConductivity(volVars.fluidState(), FluidSystem::gasPhaseIdx)
                                     * (volVars.temperature() - temperatureInitial_)/boundaryLayerThickness;
         }
         return values;
diff --git a/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh b/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh
index 048843e3d7cd24594baf6920b8282b0d2c3f9533..cfdddf7494aca241d751ae0ae413b1c4e6342ddf 100644
--- a/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh
+++ b/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh
@@ -33,8 +33,8 @@
 
 #include "richardswelltracerspatialparams.hh"
 
-namespace Dumux
-{
+namespace Dumux {
+
 /*!
  * \ingroup RichardsNCTests
  * \brief A water infiltration problem with a low-permeability lens
@@ -105,14 +105,14 @@ class RichardsWellTracerProblem : public PorousMediumFlowProblem<TypeTag>
     using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
     using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
     enum {
         pressureIdx = Indices::pressureIdx,
         compIdx = Indices::compMainIdx + 1,
-        wPhaseIdx = Indices::wPhaseIdx,
+        liquidPhaseIdx = FluidSystem::phase0Idx,
 
         dimWorld = GridView::dimensionworld
     };
@@ -161,8 +161,8 @@ public:
             for (auto&& scv : scvs(fvGeometry))
             {
                 const auto& volVars = elemVolVars[scv];
-                tracerMass += volVars.massFraction(wPhaseIdx, compIdx)*volVars.density(wPhaseIdx)
-                              * scv.volume() * volVars.saturation(wPhaseIdx) * volVars.porosity() * volVars.extrusionFactor();
+                tracerMass += volVars.massFraction(liquidPhaseIdx, compIdx)*volVars.density(liquidPhaseIdx)
+                              * scv.volume() * volVars.saturation(liquidPhaseIdx) * volVars.porosity() * volVars.extrusionFactor();
 
                 accumulatedSource_ += this->scvPointSources(element, fvGeometry, elemVolVars, scv)[compIdx]
                                        * scv.volume() * volVars.extrusionFactor()
@@ -287,8 +287,8 @@ public:
                         const auto& volVars = elemVolVars[scv];
                         //! convert pump rate from kg/s to mol/s
                         //! We assume we can't keep up the pump rate if the saturation sinks
-                        const Scalar value = pumpRate_*volVars.molarDensity(wPhaseIdx)/volVars.density(wPhaseIdx)*volVars.saturation(wPhaseIdx);
-                        return PrimaryVariables({-value, -value*volVars.moleFraction(wPhaseIdx, compIdx)});
+                        const Scalar value = pumpRate_*volVars.molarDensity(liquidPhaseIdx)/volVars.density(liquidPhaseIdx)*volVars.saturation(liquidPhaseIdx);
+                        return PrimaryVariables({-value, -value*volVars.moleFraction(liquidPhaseIdx, compIdx)});
                     });
     }
 
diff --git a/test/porousmediumflow/richardsnc/implicit/richardswelltracerspatialparams.hh b/test/porousmediumflow/richardsnc/implicit/richardswelltracerspatialparams.hh
index bc37f894de6a0ead920da11aab200da02dc9fd18..b544465a97e3e33e7545fec66622d6d08c04062f 100644
--- a/test/porousmediumflow/richardsnc/implicit/richardswelltracerspatialparams.hh
+++ b/test/porousmediumflow/richardsnc/implicit/richardswelltracerspatialparams.hh
@@ -33,8 +33,8 @@
 #include <dumux/io/gnuplotinterface.hh>
 #include <dumux/io/plotmateriallaw.hh>
 
-namespace Dumux
-{
+namespace Dumux {
+
 /*!
  * \ingroup RichardsNCTests
  * \brief spatial parameters for the RichardsWellTracerProblem
@@ -76,10 +76,10 @@ class RichardsWellTracerSpatialParams : public FVSpatialParams<TypeTag>
     enum { dimWorld=GridView::dimensionworld };
 
     using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
-    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
-    using MaterialLawParams = typename MaterialLaw::Params;
 
 public:
+    using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
+    using MaterialLawParams = typename MaterialLaw::Params;
     // export permeability type
     using PermeabilityType = Scalar;
 
diff --git a/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh b/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh
index 809268cd475e75a69a9e807f1b516bc7bf57faf4..ae7c4754294d4de86b52d1532428cc69decc86af 100644
--- a/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh
+++ b/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh
@@ -134,7 +134,7 @@ class TracerTestProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
diff --git a/test/porousmediumflow/tracer/constvel/tracertestproblem.hh b/test/porousmediumflow/tracer/constvel/tracertestproblem.hh
index d6455f754b21853cf0640a74f79c18904756c4c1..1c519d491e6df07b814a4a37a655384a8d13c0d2 100644
--- a/test/porousmediumflow/tracer/constvel/tracertestproblem.hh
+++ b/test/porousmediumflow/tracer/constvel/tracertestproblem.hh
@@ -160,7 +160,7 @@ class TracerTest : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
diff --git a/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh b/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh
index 50f5ee822e1c1bff50dcd8e92837824734e9a622..ff4374189776c9eb602c09828cc4964bf7b113f2 100644
--- a/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh
+++ b/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh
@@ -178,7 +178,7 @@ class MaxwellStefanTestProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
 
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
diff --git a/test/references/test_channel_zeroeq2c.vtu b/test/references/test_channel_zeroeq2c.vtu
index d71fcfbb7c829950e25d137e814a810b518923d6..06e858b8b0699fce41a2bbc76f1575205b15a7a3 100644
--- a/test/references/test_channel_zeroeq2c.vtu
+++ b/test/references/test_channel_zeroeq2c.vtu
@@ -61,42 +61,42 @@
           1.23012 1.23012 1.23012 1.23011 1.23011 1.23011 1.23011 1.23011
         </DataArray>
         <DataArray type="Float32" Name="X^H2O_gas" NumberOfComponents="1" format="ascii">
-          2.65777e-10 8.28297e-09 6.43671e-08 3.17545e-07 8.78319e-07 2.20687e-06 4.45017e-06 7.5922e-06 1.14902e-05 1.59995e-05 2.65909e-10 8.283e-09
-          6.43672e-08 3.17545e-07 8.78321e-07 2.20688e-06 4.45017e-06 7.5922e-06 1.14903e-05 1.59995e-05 2.66355e-10 8.2833e-09 6.43683e-08 3.1755e-07
-          8.7833e-07 2.2069e-06 4.45021e-06 7.59225e-06 1.14903e-05 1.59996e-05 2.6749e-10 8.28471e-09 6.43738e-08 3.17571e-07 8.78372e-07 2.20699e-06
-          4.45036e-06 7.59247e-06 1.14906e-05 1.59999e-05 2.7009e-10 8.28999e-09 6.43945e-08 3.17651e-07 8.78532e-07 2.20735e-06 4.45095e-06 7.59326e-06
-          1.14915e-05 1.6001e-05 2.75746e-10 8.30731e-09 6.44642e-08 3.17917e-07 8.79068e-07 2.20855e-06 4.4529e-06 7.59592e-06 1.14947e-05 1.60046e-05
-          2.87751e-10 8.35961e-09 6.46813e-08 3.18743e-07 8.80733e-07 2.21228e-06 4.45897e-06 7.60417e-06 1.15047e-05 1.60159e-05 3.13019e-10 8.5063e-09
-          6.53201e-08 3.21179e-07 8.85654e-07 2.22329e-06 4.47688e-06 7.62855e-06 1.15341e-05 1.60493e-05 3.66393e-10 8.88246e-09 6.70741e-08 3.27936e-07
-          8.99373e-07 2.25409e-06 4.52703e-06 7.69685e-06 1.16167e-05 1.61428e-05 4.80846e-10 9.7415e-09 7.14134e-08 3.44986e-07 9.34239e-07 2.33292e-06
-          4.6557e-06 7.87249e-06 1.18294e-05 1.6384e-05 7.45486e-10 1.16773e-08 8.07605e-08 3.82806e-07 1.01206e-06 2.51035e-06 4.94522e-06 8.26837e-06
-          1.23102e-05 1.69301e-05 1.47346e-09 1.66378e-08 1.01403e-07 4.55342e-07 1.1619e-06 2.85729e-06 5.51002e-06 9.04016e-06 1.32472e-05 1.79941e-05
-          3.98877e-09 3.12236e-08 1.56257e-07 6.17485e-07 1.47441e-06 3.492e-06 6.49581e-06 1.03468e-05 1.48257e-05 1.97786e-05 1.56754e-08 8.40562e-08
-          3.27175e-07 1.08267e-06 2.29156e-06 4.92891e-06 8.57138e-06 1.29654e-05 1.78832e-05 2.31567e-05 9.73151e-08 3.66778e-07 1.00626e-06 2.62992e-06
-          4.73703e-06 8.98951e-06 1.40994e-05 1.96443e-05 2.53561e-05 3.11627e-05 1.00935e-06 2.71993e-06 5.15936e-06 9.40269e-06 1.38032e-05 2.22026e-05
-          3.02952e-05 3.77831e-05 4.45936e-05 5.09726e-05 1.77237e-05 3.16985e-05 4.33598e-05 5.45707e-05 6.36023e-05 7.68708e-05 8.67732e-05 9.40405e-05
-          9.93858e-05 0.000103857 0.00053848 0.000487718 0.000449989 0.000416678 0.000388426 0.000355546 0.000327145 0.000302652 0.000281681 0.000264866
-          3.69128e-05 5.76213e-05 7.16518e-05 8.25588e-05 9.12941e-05 9.9393e-05 0.000106037 0.00011147 0.000115781 0.000118557 1.13204e-06 2.34985e-06
-          3.54277e-06 4.75437e-06 5.98273e-06 7.28947e-06 8.6346e-06 1.00035e-05 1.13475e-05 1.24641e-05
+          2.65777e-10 8.28347e-09 6.43719e-08 3.17571e-07 8.78393e-07 2.20706e-06 4.45056e-06 7.59288e-06 1.14913e-05 1.6001e-05 2.65909e-10 8.2835e-09
+          6.4372e-08 3.17571e-07 8.78394e-07 2.20706e-06 4.45057e-06 7.59289e-06 1.14913e-05 1.6001e-05 2.66355e-10 8.2838e-09 6.43731e-08 3.17576e-07
+          8.78403e-07 2.20709e-06 4.4506e-06 7.59293e-06 1.14914e-05 1.6001e-05 2.6749e-10 8.28521e-09 6.43786e-08 3.17597e-07 8.78446e-07 2.20718e-06
+          4.45076e-06 7.59315e-06 1.14916e-05 1.60013e-05 2.7009e-10 8.29049e-09 6.43993e-08 3.17677e-07 8.78606e-07 2.20754e-06 4.45134e-06 7.59395e-06
+          1.14926e-05 1.60024e-05 2.75746e-10 8.30782e-09 6.4469e-08 3.17942e-07 8.79142e-07 2.20874e-06 4.4533e-06 7.5966e-06 1.14958e-05 1.60061e-05
+          2.87751e-10 8.36012e-09 6.46861e-08 3.18769e-07 8.80807e-07 2.21247e-06 4.45936e-06 7.60485e-06 1.15057e-05 1.60174e-05 3.13019e-10 8.50681e-09
+          6.5325e-08 3.21205e-07 8.85729e-07 2.22349e-06 4.47728e-06 7.62923e-06 1.15352e-05 1.60507e-05 3.66393e-10 8.88299e-09 6.7079e-08 3.27963e-07
+          8.99448e-07 2.25428e-06 4.52743e-06 7.69754e-06 1.16177e-05 1.61442e-05 4.80846e-10 9.74208e-09 7.14187e-08 3.45014e-07 9.34317e-07 2.33311e-06
+          4.6561e-06 7.87319e-06 1.18305e-05 1.63855e-05 7.45486e-10 1.1678e-08 8.07664e-08 3.82837e-07 1.01214e-06 2.51056e-06 4.94566e-06 8.26911e-06
+          1.23113e-05 1.69317e-05 1.47346e-09 1.66387e-08 1.0141e-07 4.55379e-07 1.16199e-06 2.85753e-06 5.5105e-06 9.04097e-06 1.32484e-05 1.79958e-05
+          3.98879e-09 3.12254e-08 1.56269e-07 6.17535e-07 1.47454e-06 3.49229e-06 6.49638e-06 1.03477e-05 1.4827e-05 1.97804e-05 1.56755e-08 8.4061e-08
+          3.27198e-07 1.08276e-06 2.29175e-06 4.92933e-06 8.57212e-06 1.29666e-05 1.78848e-05 2.31588e-05 9.73167e-08 3.66799e-07 1.00633e-06 2.63013e-06
+          4.73742e-06 8.99028e-06 1.41006e-05 1.9646e-05 2.53584e-05 3.11655e-05 1.00938e-06 2.7201e-06 5.15974e-06 9.40345e-06 1.38044e-05 2.22045e-05
+          3.02979e-05 3.77865e-05 4.45976e-05 5.09772e-05 1.77244e-05 3.17006e-05 4.33631e-05 5.45752e-05 6.36078e-05 7.68775e-05 8.67808e-05 9.40489e-05
+          9.93948e-05 0.000103866 0.00053852 0.000487757 0.000450027 0.000416713 0.00038846 0.000355578 0.000327175 0.000302679 0.000281706 0.000264889
+          3.68683e-05 5.75819e-05 7.16167e-05 8.25271e-05 9.12654e-05 9.9367e-05 0.000106013 0.000111449 0.000115762 0.000118539 1.13044e-06 2.34737e-06
+          3.53972e-06 4.75087e-06 5.97888e-06 7.2853e-06 8.63018e-06 9.99889e-06 1.13426e-05 1.24591e-05
         </DataArray>
         <DataArray type="Float32" Name="x^H2O_gas" NumberOfComponents="1" format="ascii">
-          4.27245e-10 1.33151e-08 1.03472e-07 5.10464e-07 1.41193e-06 3.54762e-06 7.15378e-06 1.22047e-05 1.84708e-05 2.57194e-05 4.27458e-10 1.33152e-08
-          1.03472e-07 5.10465e-07 1.41193e-06 3.54762e-06 7.15378e-06 1.22047e-05 1.84708e-05 2.57195e-05 4.28175e-10 1.33157e-08 1.03474e-07 5.10472e-07
-          1.41194e-06 3.54765e-06 7.15384e-06 1.22047e-05 1.84709e-05 2.57196e-05 4.29999e-10 1.33179e-08 1.03483e-07 5.10506e-07 1.41201e-06 3.54781e-06
-          7.15409e-06 1.22051e-05 1.84713e-05 2.572e-05 4.34178e-10 1.33264e-08 1.03516e-07 5.10634e-07 1.41227e-06 3.54839e-06 7.15503e-06 1.22064e-05
-          1.84729e-05 2.57218e-05 4.43271e-10 1.33543e-08 1.03628e-07 5.11062e-07 1.41313e-06 3.55031e-06 7.15817e-06 1.22106e-05 1.84781e-05 2.57277e-05
-          4.62569e-10 1.34384e-08 1.03977e-07 5.12389e-07 1.41581e-06 3.55631e-06 7.16792e-06 1.22239e-05 1.84941e-05 2.57459e-05 5.03188e-10 1.36742e-08
-          1.05004e-07 5.16305e-07 1.42372e-06 3.57401e-06 7.19672e-06 1.22631e-05 1.85414e-05 2.57995e-05 5.88989e-10 1.42789e-08 1.07824e-07 5.27169e-07
-          1.44577e-06 3.62352e-06 7.27734e-06 1.23729e-05 1.8674e-05 2.59498e-05 7.72975e-10 1.56598e-08 1.14799e-07 5.54576e-07 1.50182e-06 3.75023e-06
-          7.48417e-06 1.26552e-05 1.90161e-05 2.63376e-05 1.19839e-09 1.87716e-08 1.29825e-07 6.15373e-07 1.62691e-06 4.03546e-06 7.94959e-06 1.32916e-05
-          1.9789e-05 2.72155e-05 2.36863e-09 2.67457e-08 1.63008e-07 7.31977e-07 1.86779e-06 4.59318e-06 8.85751e-06 1.45323e-05 2.12952e-05 2.89259e-05
-          6.41208e-09 5.01929e-08 2.51189e-07 9.92628e-07 2.37017e-06 5.61349e-06 1.04422e-05 1.66326e-05 2.38325e-05 3.17943e-05 2.51987e-08 1.35123e-07
-          5.25944e-07 1.74043e-06 3.68375e-06 7.92336e-06 1.37787e-05 2.08422e-05 2.87475e-05 3.72246e-05 1.56437e-07 5.89607e-07 1.6176e-06 4.22767e-06
-          7.6149e-06 1.44509e-05 2.2665e-05 3.15785e-05 4.07602e-05 5.00941e-05 1.62257e-06 4.37237e-06 8.29381e-06 1.51151e-05 2.21889e-05 3.56909e-05
-          4.86997e-05 6.07362e-05 7.16838e-05 8.19376e-05 2.84912e-05 5.09554e-05 6.97004e-05 8.77212e-05 0.000102239 0.000123567 0.000139483 0.000151165
-          0.000159756 0.000166943 0.000865341 0.00078379 0.000723175 0.000669653 0.00062426 0.000571428 0.000525793 0.000486434 0.000452733 0.000425712
-          5.93372e-05 9.26249e-05 0.000115178 0.000132709 0.00014675 0.000159768 0.000170447 0.00017918 0.000186109 0.000190571 1.81979e-06 3.77746e-06
-          5.69511e-06 7.64278e-06 9.6174e-06 1.1718e-05 1.38803e-05 1.60809e-05 1.82413e-05 2.00362e-05
+          4.27245e-10 1.3316e-08 1.0348e-07 5.10505e-07 1.41205e-06 3.54792e-06 7.15441e-06 1.22058e-05 1.84725e-05 2.57218e-05 4.27458e-10 1.3316e-08
+          1.0348e-07 5.10506e-07 1.41205e-06 3.54793e-06 7.15441e-06 1.22058e-05 1.84725e-05 2.57218e-05 4.28175e-10 1.33165e-08 1.03482e-07 5.10514e-07
+          1.41206e-06 3.54796e-06 7.15447e-06 1.22058e-05 1.84726e-05 2.57219e-05 4.29999e-10 1.33188e-08 1.03491e-07 5.10548e-07 1.41213e-06 3.54811e-06
+          7.15472e-06 1.22062e-05 1.8473e-05 2.57224e-05 4.34178e-10 1.33272e-08 1.03524e-07 5.10676e-07 1.41239e-06 3.54869e-06 7.15566e-06 1.22075e-05
+          1.84746e-05 2.57242e-05 4.43271e-10 1.33551e-08 1.03636e-07 5.11103e-07 1.41325e-06 3.55062e-06 7.1588e-06 1.22117e-05 1.84797e-05 2.57301e-05
+          4.62569e-10 1.34392e-08 1.03985e-07 5.12431e-07 1.41593e-06 3.55661e-06 7.16855e-06 1.2225e-05 1.84957e-05 2.57482e-05 5.03188e-10 1.3675e-08
+          1.05012e-07 5.16347e-07 1.42384e-06 3.57432e-06 7.19735e-06 1.22642e-05 1.8543e-05 2.58019e-05 5.88989e-10 1.42797e-08 1.07832e-07 5.27211e-07
+          1.44589e-06 3.62383e-06 7.27798e-06 1.2374e-05 1.86757e-05 2.59521e-05 7.72975e-10 1.56607e-08 1.14808e-07 5.54621e-07 1.50195e-06 3.75055e-06
+          7.48482e-06 1.26564e-05 1.90178e-05 2.634e-05 1.19839e-09 1.87727e-08 1.29835e-07 6.15423e-07 1.62705e-06 4.0358e-06 7.95028e-06 1.32928e-05
+          1.97908e-05 2.72179e-05 2.36864e-09 2.67473e-08 1.6302e-07 7.32036e-07 1.86794e-06 4.59357e-06 8.85829e-06 1.45336e-05 2.12971e-05 2.89285e-05
+          6.41211e-09 5.01958e-08 2.51207e-07 9.92707e-07 2.37036e-06 5.61397e-06 1.04431e-05 1.66341e-05 2.38347e-05 3.17973e-05 2.51989e-08 1.35131e-07
+          5.25982e-07 1.74056e-06 3.68406e-06 7.92403e-06 1.37799e-05 2.0844e-05 2.87501e-05 3.7228e-05 1.5644e-07 5.89642e-07 1.61771e-06 4.22801e-06
+          7.61554e-06 1.44521e-05 2.2667e-05 3.15813e-05 4.07639e-05 5.00987e-05 1.62261e-06 4.37264e-06 8.29443e-06 1.51163e-05 2.21908e-05 3.5694e-05
+          4.8704e-05 6.07416e-05 7.16903e-05 8.1945e-05 2.84923e-05 5.09588e-05 6.97058e-05 8.77285e-05 0.000102248 0.000123577 0.000139496 0.000151178
+          0.000159771 0.000166958 0.000865406 0.000783854 0.000723235 0.000669711 0.000624315 0.00057148 0.00052584 0.000486477 0.000452774 0.00042575
+          5.92657e-05 9.25616e-05 0.000115121 0.000132658 0.000146704 0.000159726 0.000170409 0.000179145 0.000186078 0.000190541 1.81722e-06 3.77347e-06
+          5.6902e-06 7.63716e-06 9.61121e-06 1.17113e-05 1.38732e-05 1.60734e-05 1.82335e-05 2.00282e-05
         </DataArray>
         <DataArray type="Float32" Name="D^H2O_gas" NumberOfComponents="1" format="ascii">
           2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05 2.27241e-05
@@ -132,7 +132,7 @@
           1 0.999999 0.999998 0.999995 0.999991 0.999987 0.999982 0.999977 1 1 0.999999 0.999997
           0.999995 0.999991 0.999986 0.99998 0.999975 0.999969 0.999999 0.999997 0.999995 0.999991 0.999986 0.999978
           0.99997 0.999962 0.999955 0.999949 0.999982 0.999968 0.999957 0.999945 0.999936 0.999923 0.999913 0.999906
-          0.999901 0.999896 0.999462 0.999512 0.99955 0.999583 0.999612 0.999644 0.999673 0.999697 0.999718 0.999735
+          0.999901 0.999896 0.999461 0.999512 0.99955 0.999583 0.999612 0.999644 0.999673 0.999697 0.999718 0.999735
           0.999963 0.999942 0.999928 0.999917 0.999909 0.999901 0.999894 0.999889 0.999884 0.999881 0.999999 0.999998
           0.999996 0.999995 0.999994 0.999993 0.999991 0.99999 0.999989 0.999988
         </DataArray>
@@ -156,42 +156,42 @@
           0.999994 0.999992 0.99999 0.999988 0.999986 0.999984 0.999982 0.99998
         </DataArray>
         <DataArray type="Float32" Name="v_x/v_x,max" NumberOfComponents="1" format="ascii">
-          0.497709 0.00754148 0.00480969 0.00414194 0.00380329 0.00359298 0.00344841 0.00332883 0.00322103 0.00313863 0.509482 0.0254295
-          0.0163439 0.0140752 0.0129247 0.0122103 0.0117191 0.0113126 0.0109462 0.0106666 0.525557 0.0500643 0.0324738 0.0279672
-          0.0256818 0.0242629 0.0232872 0.0224794 0.0217512 0.0211964 0.547284 0.0837689 0.0550179 0.0473868 0.0435161 0.0411137
-          0.0394611 0.0380919 0.0368577 0.0359196 0.576225 0.129454 0.0864913 0.0745119 0.0684307 0.0646572 0.0620602 0.0599062
-          0.0579649 0.0564941 0.613961 0.190529 0.130311 0.112336 0.103186 0.0975082 0.0935975 0.0903487 0.0874208 0.0852126
-          0.661592 0.270389 0.190851 0.164837 0.151484 0.14319 0.137468 0.132702 0.128405 0.125184 0.718632 0.370739
-          0.272653 0.236675 0.217812 0.206042 0.197896 0.191075 0.184918 0.180338 0.781246 0.487727 0.377031 0.330983
-          0.305727 0.289783 0.278661 0.269249 0.260719 0.254422 0.841373 0.607764 0.495716 0.443622 0.412739 0.392819
-          0.378734 0.366558 0.355428 0.347257 0.893863 0.718603 0.613293 0.559624 0.526157 0.503703 0.487462 0.472949
-          0.459537 0.44973 0.937376 0.817735 0.72327 0.664387 0.628182 0.606232 0.589851 0.574056 0.559049 0.548039
-          0.969255 0.899864 0.82664 0.767072 0.725412 0.698059 0.677038 0.658332 0.641741 0.630015 0.988412 0.95661
-          0.912893 0.867103 0.82631 0.792991 0.76578 0.743122 0.724148 0.711239 0.997346 0.987121 0.968371 0.943384
-          0.915644 0.887897 0.861704 0.838329 0.818085 0.80424 1 0.998316 0.993518 0.984818 0.972699 0.957983
-          0.941326 0.924371 0.908313 0.89681 0.999959 1 1 0.998631 0.99593 0.991817 0.985767 0.97851
-          0.970839 0.964948 0.999066 0.998672 0.99972 1 1 1 0.999245 0.997952 0.996456 0.995204
-          0.998098 0.996952 0.998308 0.998829 0.999168 0.999786 1 1 1 1 0.997194 0.995146
-          0.996362 0.996596 0.996557 0.99676 0.996546 0.996109 0.995634 0.995326
+          0.497711 0.00754151 0.0048097 0.00414174 0.00380312 0.00359283 0.00344843 0.00332884 0.00322104 0.00313863 0.509484 0.0254296
+          0.016344 0.0140745 0.0129241 0.0122098 0.0117192 0.0113127 0.0109463 0.0106666 0.525559 0.0500646 0.0324739 0.0279659
+          0.0256806 0.0242619 0.0232874 0.0224795 0.0217513 0.0211965 0.547286 0.0837693 0.055018 0.0473845 0.0435142 0.041112
+          0.0394614 0.038092 0.0368578 0.0359197 0.576226 0.129454 0.0864915 0.0745083 0.0684277 0.0646546 0.0620605 0.0599064
+          0.057965 0.0564943 0.613962 0.19053 0.130311 0.112331 0.103182 0.0975043 0.093598 0.0903491 0.087421 0.0852128
+          0.661593 0.270391 0.190851 0.164829 0.151478 0.143184 0.137468 0.132702 0.128405 0.125185 0.718633 0.370741
+          0.272653 0.236664 0.217802 0.206034 0.197897 0.191076 0.184919 0.180338 0.781246 0.48773 0.377033 0.330967
+          0.305713 0.289771 0.278663 0.26925 0.26072 0.254423 0.841373 0.607768 0.495718 0.443601 0.412721 0.392804
+          0.378736 0.36656 0.355429 0.347258 0.893864 0.718608 0.613296 0.559598 0.526135 0.503684 0.487466 0.472951
+          0.459539 0.449732 0.937376 0.817742 0.723273 0.664357 0.628156 0.60621 0.589856 0.574061 0.559052 0.548042
+          0.969255 0.899871 0.826644 0.767038 0.725383 0.698033 0.677044 0.658337 0.641746 0.630019 0.988412 0.956619
+          0.912899 0.867065 0.826276 0.792962 0.765787 0.743128 0.724153 0.711244 0.997347 0.98713 0.968377 0.943342
+          0.915608 0.887864 0.861712 0.838336 0.818091 0.804245 1 0.998324 0.993524 0.984774 0.972659 0.957948
+          0.941335 0.924379 0.90832 0.896818 0.999954 1 1 0.998584 0.995888 0.991782 0.985779 0.978522
+          0.97085 0.964959 0.999095 0.998735 0.999775 1 1 1 0.999288 0.99799 0.99649 0.995236
+          0.998088 0.996942 0.998296 0.998771 0.999115 0.999738 1 1 1 1 0.997196 0.995157
+          0.996369 0.996553 0.996517 0.996725 0.996556 0.996118 0.995642 0.995334
         </DataArray>
         <DataArray type="Float32" Name="p_rel" NumberOfComponents="1" format="ascii">
-          0.00135299 0.000901319 0.000738805 0.000610656 0.000497961 0.000396487 0.000304085 0.000213298 0.000123979 3.64372e-05 0.00135292 0.000901351
-          0.000738811 0.000610659 0.000497962 0.000396488 0.000304086 0.000213299 0.000123979 3.64376e-05 0.00135281 0.000901393 0.00073882 0.000610663
-          0.000497965 0.000396489 0.000304087 0.0002133 0.00012398 3.64382e-05 0.00135265 0.000901449 0.000738833 0.000610668 0.000497968 0.000396492
-          0.000304088 0.000213301 0.000123982 3.6439e-05 0.00135241 0.000901522 0.00073885 0.000610676 0.000497973 0.000396494 0.00030409 0.000213303
-          0.000123983 3.64401e-05 0.00135205 0.000901621 0.000738875 0.000610687 0.00049798 0.000396498 0.000304093 0.000213306 0.000123986 3.64416e-05
-          0.00135152 0.000901761 0.000738909 0.000610703 0.000497989 0.000396504 0.000304098 0.00021331 0.000123989 3.64436e-05 0.00135075 0.000901994
-          0.000738959 0.000610725 0.000498002 0.000396512 0.000304104 0.000213315 0.000123994 3.64465e-05 0.00134965 0.000902436 0.000739039 0.00061076
-          0.000498023 0.000396525 0.000304113 0.000213324 0.000124002 3.6451e-05 0.00134812 0.000903284 0.000739185 0.000610826 0.000498062 0.000396547
-          0.00030413 0.000213339 0.000124016 3.64593e-05 0.00134576 0.000904453 0.000739563 0.000610953 0.000498139 0.000396592 0.000304165 0.000213369
-          0.000124043 3.64775e-05 0.00134222 0.000906041 0.0007402 0.000611378 0.000498282 0.000396669 0.000304225 0.000213424 0.000124098 3.65174e-05
-          0.0013373 0.00090835 0.000741093 0.000611788 0.000498552 0.000397001 0.000304421 0.000213576 0.000124212 3.6609e-05 0.00133063 0.000911529
-          0.00074228 0.000612352 0.000499029 0.000397433 0.000304554 0.000213635 0.000124255 3.67121e-05 0.00132179 0.000915789 0.000743827 0.000613062
-          0.000499602 0.00039793 0.000304715 0.000213732 0.000124342 3.69497e-05 0.00131036 0.000921269 0.000745824 0.000613949 0.000500255 0.000398464
-          0.000304895 0.000213845 0.000124474 3.75039e-05 0.00129609 0.000927926 0.000748357 0.000615065 0.000501012 0.00039901 0.000305094 0.000213976
-          0.000124682 3.86531e-05 0.00127934 0.000935444 0.000751425 0.000616432 0.000501856 0.000399588 0.00030537 0.000214183 0.00012505 4.05163e-05
-          0.00126172 0.000943008 0.000754784 0.000617924 0.000502744 0.000400202 0.000305691 0.000214443 0.000125541 4.26709e-05 0.00124784 0.000948738
-          0.000757584 0.000619181 0.000503492 0.000400701 0.000305954 0.000214658 0.000125964 4.43058e-05
+          0.0013529 0.000901319 0.000738798 0.000610649 0.000497955 0.000396482 0.00030408 0.000213295 0.000123977 3.64366e-05 0.00135283 0.00090135
+          0.000738805 0.000610652 0.000497956 0.000396483 0.000304081 0.000213296 0.000123977 3.6437e-05 0.00135272 0.000901392 0.000738814 0.000610656
+          0.000497959 0.000396484 0.000304082 0.000213297 0.000123978 3.64376e-05 0.00135256 0.000901448 0.000738826 0.000610662 0.000497962 0.000396486
+          0.000304084 0.000213298 0.00012398 3.64384e-05 0.00135232 0.000901522 0.000738844 0.00061067 0.000497967 0.000396489 0.000304086 0.0002133
+          0.000123981 3.64395e-05 0.00135196 0.00090162 0.000738868 0.000610681 0.000497974 0.000396493 0.000304089 0.000213303 0.000123984 3.64409e-05
+          0.00135143 0.000901761 0.000738903 0.000610696 0.000497983 0.000396499 0.000304093 0.000213307 0.000123987 3.6443e-05 0.00135065 0.000901994
+          0.000738953 0.000610719 0.000497996 0.000396507 0.0003041 0.000213312 0.000123992 3.64459e-05 0.00134956 0.000902435 0.000739032 0.000610754
+          0.000498017 0.000396519 0.000304109 0.000213321 0.000124 3.64503e-05 0.00134803 0.000903283 0.000739179 0.00061082 0.000498056 0.000396542
+          0.000304126 0.000213336 0.000124014 3.64587e-05 0.00134566 0.000904452 0.000739556 0.000610946 0.000498133 0.000396587 0.00030416 0.000213366
+          0.000124041 3.64769e-05 0.00134212 0.000906041 0.000740194 0.000611371 0.000498276 0.000396664 0.000304221 0.000213421 0.000124096 3.65168e-05
+          0.00133721 0.00090835 0.000741086 0.000611782 0.000498546 0.000396996 0.000304417 0.000213573 0.00012421 3.66084e-05 0.00133054 0.000911528
+          0.000742273 0.000612346 0.000499023 0.000397428 0.00030455 0.000213632 0.000124253 3.67115e-05 0.0013217 0.000915789 0.000743821 0.000613056
+          0.000499596 0.000397925 0.000304711 0.000213729 0.00012434 3.6949e-05 0.00131027 0.00092127 0.000745817 0.000613942 0.000500249 0.000398459
+          0.000304891 0.000213842 0.000124472 3.75033e-05 0.001296 0.000927928 0.00074835 0.000615058 0.000501007 0.000399005 0.00030509 0.000213973
+          0.00012468 3.86524e-05 0.00127923 0.000935455 0.000751417 0.000616426 0.00050185 0.000399583 0.000305365 0.00021418 0.000125048 4.05155e-05
+          0.00126165 0.000942988 0.000754776 0.000617917 0.000502738 0.000400197 0.000305687 0.00021444 0.000125539 4.26702e-05 0.00124777 0.000948715
+          0.000757576 0.000619174 0.000503486 0.000400696 0.000305949 0.000214655 0.000125962 4.43051e-05
         </DataArray>
         <DataArray type="Float32" Name="nu" NumberOfComponents="1" format="ascii">
           1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05
@@ -213,23 +213,23 @@
           1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05 1.43728e-05
         </DataArray>
         <DataArray type="Float32" Name="nu_t" NumberOfComponents="1" format="ascii">
-          6.12338e-14 1.47341e-13 6.26502e-14 4.72966e-14 4.04915e-14 3.66068e-14 3.41485e-14 3.22168e-14 3.05148e-14 2.92193e-14 8.0176e-12 1.93589e-11
-          8.31691e-12 6.2815e-12 5.37898e-12 4.86371e-12 4.53756e-12 4.28117e-12 4.05526e-12 3.88346e-12 1.20482e-10 2.93413e-10 1.287e-10 9.72709e-11
-          8.33247e-11 7.53616e-11 7.03187e-11 6.63515e-11 6.28555e-11 6.02024e-11 9.43066e-10 2.32511e-09 1.04968e-09 7.9426e-10 6.80743e-10 6.1591e-10
-          5.74823e-10 5.42464e-10 5.13946e-10 4.92364e-10 5.36003e-09 1.34505e-08 6.31826e-09 4.79144e-09 4.11019e-09 3.72083e-09 3.4738e-09 3.27892e-09
-          3.10711e-09 2.9776e-09 2.49693e-08 6.42485e-08 3.18571e-08 2.42769e-08 2.08596e-08 1.89022e-08 1.76579e-08 1.66733e-08 1.58047e-08 1.51533e-08
-          9.98604e-08 2.65909e-07 1.41687e-07 1.09203e-07 9.41796e-08 8.55189e-08 7.99907e-08 7.55905e-08 7.17006e-08 6.88006e-08 3.44838e-07 9.58515e-07
-          5.59593e-07 4.41905e-07 3.84377e-07 3.50679e-07 3.28973e-07 3.11476e-07 2.95916e-07 2.84374e-07 1.00669e-06 2.93171e-06 1.90675e-06 1.57172e-06
-          1.39001e-06 1.28024e-06 1.20837e-06 1.14885e-06 1.0952e-06 1.05542e-06 2.49541e-06 7.56214e-06 5.45028e-06 4.71201e-06 4.27768e-06 3.9976e-06
-          3.80852e-06 3.64396e-06 3.4927e-06 3.38006e-06 3.74084e-06 1.06878e-05 1.34535e-05 1.17464e-05 1.08364e-05 1.03622e-05 1.00219e-05 9.67388e-06
-          9.33436e-06 9.07652e-06 3.72778e-06 1.06506e-05 1.74195e-05 2.70062e-05 2.46482e-05 2.32847e-05 2.22543e-05 2.14121e-05 2.07283e-05 2.02527e-05
-          3.62916e-06 1.03688e-05 1.73588e-05 2.71061e-05 2.88302e-05 4.15878e-05 4.41715e-05 4.55827e-05 4.39962e-05 4.30208e-05 3.01416e-06 8.61168e-06
-          1.69049e-05 2.70119e-05 2.87299e-05 4.15688e-05 4.41514e-05 4.5562e-05 4.62771e-05 4.65938e-05 1.31169e-06 3.74759e-06 1.4084e-05 2.63113e-05
-          2.79848e-05 4.14245e-05 4.39981e-05 4.54038e-05 4.61164e-05 4.6432e-05 2.47262e-07 7.06444e-07 6.19947e-06 2.19686e-05 2.33659e-05 4.03564e-05
-          4.28636e-05 4.42331e-05 4.49273e-05 4.52348e-05 3.45176e-08 9.86194e-08 1.18043e-06 9.74843e-06 1.03685e-05 3.37474e-05 3.5844e-05 3.69892e-05
-          3.75698e-05 3.78269e-05 4.59098e-09 1.31168e-08 1.65474e-07 1.86955e-06 1.98846e-06 1.5061e-05 1.59966e-05 1.65077e-05 1.67668e-05 1.68816e-05
-          6.0752e-10 1.73573e-09 2.20554e-08 2.62857e-07 2.79576e-07 2.90324e-06 3.0836e-06 3.18212e-06 3.23207e-06 3.25419e-06 8.04262e-11 2.29784e-10
-          2.92259e-09 3.50884e-08 3.73202e-08 4.09064e-07 4.34478e-07 4.4836e-07 4.55397e-07 4.58514e-07
+          6.12324e-14 1.47338e-13 6.26489e-14 4.72956e-14 4.04906e-14 3.6606e-14 3.41477e-14 3.22161e-14 3.05141e-14 2.92186e-14 8.01741e-12 1.93585e-11
+          8.31674e-12 6.28136e-12 5.37885e-12 4.8636e-12 4.53745e-12 4.28107e-12 4.05516e-12 3.88336e-12 1.20479e-10 2.93406e-10 1.28698e-10 9.72687e-11
+          8.33228e-11 7.53599e-11 7.03171e-11 6.635e-11 6.28541e-11 6.0201e-11 9.43044e-10 2.32506e-09 1.04966e-09 7.94243e-10 6.80728e-10 6.15896e-10
+          5.7481e-10 5.42452e-10 5.13934e-10 4.92352e-10 5.3599e-09 1.34502e-08 6.31813e-09 4.79134e-09 4.1101e-09 3.72074e-09 3.47372e-09 3.27884e-09
+          3.10704e-09 2.97753e-09 2.49687e-08 6.42471e-08 3.18565e-08 2.42764e-08 2.08591e-08 1.89018e-08 1.76575e-08 1.66729e-08 1.58044e-08 1.5153e-08
+          9.98582e-08 2.65904e-07 1.41685e-07 1.09201e-07 9.41775e-08 8.5517e-08 7.99889e-08 7.55888e-08 7.16989e-08 6.87991e-08 3.44831e-07 9.58496e-07
+          5.59583e-07 4.41896e-07 3.84369e-07 3.50671e-07 3.28966e-07 3.11469e-07 2.9591e-07 2.84368e-07 1.00668e-06 2.93166e-06 1.90672e-06 1.57169e-06
+          1.38999e-06 1.28021e-06 1.20834e-06 1.14882e-06 1.09518e-06 1.0554e-06 2.49537e-06 7.56203e-06 5.4502e-06 4.71193e-06 4.2776e-06 3.99753e-06
+          3.80845e-06 3.6439e-06 3.49264e-06 3.38e-06 3.74081e-06 1.06878e-05 1.34533e-05 1.17462e-05 1.08362e-05 1.0362e-05 1.00218e-05 9.67374e-06
+          9.33422e-06 9.07638e-06 3.72776e-06 1.06505e-05 1.74193e-05 2.70059e-05 2.46479e-05 2.32844e-05 2.22541e-05 2.14118e-05 2.0728e-05 2.02524e-05
+          3.62914e-06 1.03687e-05 1.73587e-05 2.71059e-05 2.88299e-05 4.15874e-05 4.41711e-05 4.55825e-05 4.39957e-05 4.30203e-05 3.01414e-06 8.61161e-06
+          1.69048e-05 2.70117e-05 2.87297e-05 4.15684e-05 4.4151e-05 4.55617e-05 4.62769e-05 4.65937e-05 1.31168e-06 3.74756e-06 1.40839e-05 2.63111e-05
+          2.79846e-05 4.14241e-05 4.39977e-05 4.54035e-05 4.61162e-05 4.64319e-05 2.4726e-07 7.06439e-07 6.19942e-06 2.19685e-05 2.33657e-05 4.0356e-05
+          4.28632e-05 4.42328e-05 4.49271e-05 4.52346e-05 3.45174e-08 9.86186e-08 1.18042e-06 9.74835e-06 1.03684e-05 3.37471e-05 3.58437e-05 3.6989e-05
+          3.75696e-05 3.78268e-05 4.59095e-09 1.31167e-08 1.65473e-07 1.86954e-06 1.98845e-06 1.50608e-05 1.59965e-05 1.65076e-05 1.67668e-05 1.68815e-05
+          6.07516e-10 1.73572e-09 2.20552e-08 2.62855e-07 2.79574e-07 2.90321e-06 3.08358e-06 3.18211e-06 3.23206e-06 3.25418e-06 8.04257e-11 2.29782e-10
+          2.92257e-09 3.50881e-08 3.73199e-08 4.0906e-07 4.34475e-07 4.48357e-07 4.55395e-07 4.58512e-07
         </DataArray>
         <DataArray type="Float32" Name="l_w" NumberOfComponents="1" format="ascii">
           0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000406853 0.000406853
@@ -251,217 +251,217 @@
           0.428486 0.428486 0.428486 0.428486 0.428486 0.428486 0.428486 0.428486
         </DataArray>
         <DataArray type="Float32" Name="y^+" NumberOfComponents="1" format="ascii">
-          0.0643761 0.0801908 0.0647456 0.0603488 0.0580487 0.0566025 0.0556268 0.0548225 0.0540833 0.0534996 0.218879 0.272649
-          0.220135 0.205186 0.197366 0.192449 0.189131 0.186397 0.183883 0.181899 0.435183 0.54209 0.43768 0.407958
-          0.392409 0.382633 0.376037 0.3706 0.365603 0.361657 0.738008 0.919308 0.742243 0.691839 0.66547 0.648892
-          0.637706 0.628485 0.620011 0.613319 1.16196 1.44741 1.16863 1.08927 1.04776 1.02165 1.00404 0.989524
-          0.976181 0.965646 1.7555 2.18676 1.76558 1.64568 1.58296 1.54352 1.51691 1.49498 1.47482 1.4589
-          2.58645 3.22184 2.6013 2.42465 2.33223 2.27413 2.23493 2.20262 2.17292 2.14946 3.74979 4.67096
-          3.77131 3.5152 3.38123 3.29699 3.24016 3.19331 3.15025 3.11625 5.37846 6.69973 5.40932 5.04198
-          4.84981 4.72899 4.64747 4.58027 4.51851 4.46975 7.65859 9.54 7.70254 7.17947 6.90584 6.73379
-          6.61772 6.52203 6.43409 6.36465 10.8508 13.5164 10.913 10.172 9.78427 9.54052 9.37606 9.24049
-          9.11589 9.0175 15.3198 19.0833 15.4078 14.3614 13.8141 13.4699 13.2377 13.0463 12.8704 12.7315
-          21.5765 26.877 21.7004 20.2267 19.4558 18.9711 18.6441 18.3745 18.1267 17.9311 30.3359 37.7882
-          30.51 28.4381 27.3542 26.6728 26.213 25.834 25.4856 25.2106 42.599 53.0639 42.8435 39.9341
-          38.412 37.4551 36.8095 36.2773 35.7881 35.4019 59.7674 74.4499 60.1104 56.0285 53.8931 52.5505
-          51.6447 50.898 50.2117 49.6698 83.8034 104.391 84.2848 78.5613 75.5672 73.6848 72.4148 71.3678
-          70.4054 69.6456 117.467 146.322 118.139 110.115 105.918 103.278 101.497 100.029 98.6798 97.6143
-          164.564 204.992 165.51 154.271 148.391 144.695 142.201 140.145 138.255 136.763 230.517 287.146
-          231.84 216.096 207.86 202.682 199.188 196.308 193.66 191.57
+          0.0643758 0.0801904 0.0647452 0.0603485 0.0580484 0.0566022 0.0556265 0.0548222 0.054083 0.0534993 0.218878 0.272647
+          0.220134 0.205185 0.197364 0.192448 0.18913 0.186395 0.183882 0.181897 0.43518 0.542087 0.437678 0.407956
+          0.392407 0.382631 0.376035 0.370598 0.365601 0.361655 0.738004 0.919302 0.742239 0.691835 0.665466 0.648888
+          0.637702 0.628482 0.620007 0.613316 1.16196 1.4474 1.16863 1.08927 1.04775 1.02165 1.00404 0.989518
+          0.976176 0.96564 1.75549 2.18675 1.76557 1.64567 1.58295 1.54351 1.5169 1.49497 1.47481 1.45889
+          2.58644 3.22183 2.60128 2.42463 2.33222 2.27412 2.23492 2.2026 2.1729 2.14945 3.74977 4.67094
+          3.77129 3.51518 3.38121 3.29697 3.24014 3.19329 3.15023 3.11623 5.37842 6.69969 5.40929 5.04195
+          4.84979 4.72897 4.64745 4.58025 4.51849 4.46972 7.65854 9.53995 7.7025 7.17943 6.9058 6.73376
+          6.61768 6.52199 6.43405 6.36461 10.8507 13.5163 10.913 10.1719 9.78421 9.54046 9.376 9.24043
+          9.11583 9.01745 15.3198 19.0832 15.4077 14.3614 13.814 13.4699 13.2377 13.0463 12.8703 12.7314
+          21.5764 26.8769 21.7002 20.2266 19.4557 18.971 18.644 18.3744 18.1266 17.931 30.3357 37.788
+          30.5098 28.4379 27.3541 26.6726 26.2128 25.8338 25.4855 25.2104 42.5988 53.0636 42.8433 39.9338
+          38.4118 37.4549 36.8093 36.2771 35.7879 35.4017 59.767 74.4495 60.1101 56.0282 53.8928 52.5502
+          51.6444 50.8977 50.2114 49.6696 83.8029 104.39 84.2843 78.5609 75.5668 73.6844 72.4144 71.3673
+          70.405 69.6452 117.466 146.322 118.138 110.115 105.917 103.278 101.497 100.029 98.6792 97.6138
+          164.563 204.991 165.509 154.27 148.39 144.694 142.2 140.144 138.254 136.762 230.516 287.144
+          231.839 216.095 207.859 202.68 199.187 196.306 193.659 191.569
         </DataArray>
         <DataArray type="Float32" Name="u^+" NumberOfComponents="1" format="ascii">
-          6.53191 0.0811393 0.0647961 0.0603937 0.0580902 0.056641 0.0556639 0.0548594 0.05412 0.0535333 6.68641 0.273597
-          0.220186 0.205231 0.197407 0.192487 0.189168 0.186433 0.18392 0.181932 6.89738 0.538646 0.437488 0.40779
-          0.392255 0.38249 0.3759 0.370463 0.365466 0.361532 7.18253 0.901275 0.741201 0.690947 0.66465 0.648132
-          0.636977 0.627758 0.619287 0.612656 7.56234 1.3928 1.16521 1.08646 1.04519 1.01928 1.00177 0.987261
-          0.973932 0.96358 8.05759 2.04991 1.75555 1.63798 1.57603 1.53716 1.51084 1.48896 1.46885 1.45341
-          8.68271 2.90914 2.57114 2.40349 2.31372 2.25729 2.21898 2.18694 2.15748 2.13518 9.4313 3.98881
-          3.67318 3.45096 3.32678 3.24813 3.19441 3.14894 3.10702 3.07589 10.253 5.24749 5.07937 4.82606
-          4.66956 4.56825 4.49811 4.43725 4.38063 4.33949 11.0421 6.53897 6.67828 6.46846 6.30403 6.19255
-          6.11347 6.04092 5.97193 5.92292 11.731 7.7315 8.26229 8.15988 8.03634 7.94057 7.86855 7.79424
-          7.72118 7.67073 12.3021 8.79807 9.74389 9.68744 9.59464 9.55688 9.52129 9.46051 9.39319 9.34751
-          12.7205 9.6817 11.1365 11.1847 11.0797 11.0045 10.9287 10.8494 10.7826 10.7457 12.9719 10.2922
-          12.2985 12.6432 12.6208 12.501 12.3611 12.2467 12.1672 12.1311 13.0891 10.6205 13.0459 13.7555
-          13.9852 13.9971 13.9095 13.8158 13.7455 13.7173 13.124 10.741 13.3847 14.3596 14.8567 15.102
-          15.1948 15.2337 15.2616 15.2963 13.1234 10.7591 13.472 14.5611 15.2115 15.6354 15.9121 16.126
-          16.3121 16.4584 13.1117 10.7448 13.4682 14.581 15.2737 15.7644 16.1297 16.4464 16.7425 16.9745
-          13.099 10.7263 13.4492 14.5639 15.2609 15.761 16.1419 16.4801 16.8021 17.0563 13.0871 10.7068
+          6.53195 0.0811388 0.0647958 0.0603934 0.0580898 0.0566407 0.0556635 0.0548591 0.0541197 0.053533 6.68645 0.273596
+          0.220184 0.20523 0.197406 0.192486 0.189167 0.186432 0.183919 0.181931 6.89742 0.538643 0.437485 0.407788
+          0.392252 0.382488 0.375898 0.370461 0.365464 0.36153 7.18256 0.90127 0.741197 0.690943 0.664647 0.648128
+          0.636973 0.627755 0.619284 0.612652 7.56238 1.39279 1.1652 1.08645 1.04518 1.01927 1.00176 0.987255
+          0.973926 0.963574 8.05762 2.0499 1.75554 1.63797 1.57602 1.53715 1.51083 1.48895 1.46884 1.4534
+          8.68273 2.90912 2.57113 2.40348 2.31371 2.25728 2.21897 2.18693 2.15746 2.13517 9.43132 3.98879
+          3.67316 3.45095 3.32676 3.24811 3.19439 3.14892 3.107 3.07587 10.2531 5.24746 5.07934 4.82604
+          4.66954 4.56822 4.49808 4.43723 4.38061 4.33947 11.0422 6.53895 6.67826 6.46843 6.30401 6.19253
+          6.11344 6.04089 5.97191 5.92289 11.731 7.73147 8.26226 8.15985 8.03631 7.94054 7.86852 7.79421
+          7.72115 7.6707 12.3021 8.79805 9.74386 9.68741 9.59461 9.55685 9.52126 9.46049 9.39316 9.34748
+          12.7205 9.68168 11.1365 11.1847 11.0797 11.0044 10.9286 10.8494 10.7826 10.7457 12.9719 10.2922
+          12.2985 12.6432 12.6207 12.501 12.3611 12.2467 12.1672 12.1311 13.0892 10.6205 13.0459 13.7555
+          13.9852 13.9971 13.9095 13.8157 13.7455 13.7173 13.124 10.7409 13.3846 14.3596 14.8566 15.102
+          15.1947 15.2337 15.2616 15.2963 13.1234 10.759 13.4719 14.561 15.2114 15.6354 15.9121 16.126
+          16.3122 16.4585 13.1121 10.7453 13.4689 14.5816 15.2742 15.7649 16.1302 16.4468 16.743 16.9749
+          13.0989 10.7261 13.4489 14.5637 15.2607 15.7608 16.1417 16.4799 16.802 17.0561 13.0872 10.7068
           13.423 14.5314 15.2211 15.7133 16.0861 16.416 16.7287 16.9766
         </DataArray>
         <DataArray type="Float32" Name="D_t" NumberOfComponents="1" format="ascii">
-          8.74769e-14 2.10487e-13 8.95003e-14 6.75666e-14 5.7845e-14 5.22954e-14 4.87835e-14 4.6024e-14 4.35926e-14 4.17419e-14 1.14537e-11 2.76556e-11
-          1.18813e-11 8.97357e-12 7.68425e-12 6.94816e-12 6.48222e-12 6.11596e-12 5.79322e-12 5.54779e-12 1.72117e-10 4.19161e-10 1.83858e-10 1.38958e-10
-          1.19035e-10 1.07659e-10 1.00455e-10 9.47879e-11 8.97936e-11 8.60034e-11 1.34724e-09 3.32158e-09 1.49955e-09 1.13466e-09 9.72491e-10 8.79872e-10
-          8.21176e-10 7.74949e-10 7.34208e-10 7.03377e-10 7.65718e-09 1.9215e-08 9.02609e-09 6.84492e-09 5.8717e-09 5.31547e-09 4.96258e-09 4.68417e-09
-          4.43873e-09 4.25371e-09 3.56704e-08 9.17836e-08 4.55102e-08 3.46813e-08 2.97994e-08 2.70031e-08 2.52256e-08 2.3819e-08 2.25782e-08 2.16476e-08
-          1.42658e-07 3.79871e-07 2.02411e-07 1.56005e-07 1.34542e-07 1.2217e-07 1.14272e-07 1.07986e-07 1.02429e-07 9.82866e-08 4.92626e-07 1.36931e-06
-          7.99419e-07 6.31293e-07 5.49111e-07 5.00969e-07 4.69961e-07 4.44966e-07 4.22737e-07 4.06249e-07 1.43813e-06 4.18816e-06 2.72393e-06 2.24531e-06
-          1.98574e-06 1.82891e-06 1.72624e-06 1.64121e-06 1.56457e-06 1.50774e-06 3.56487e-06 1.08031e-05 7.78611e-06 6.73144e-06 6.11097e-06 5.71086e-06
-          5.44074e-06 5.20566e-06 4.98958e-06 4.82865e-06 5.34405e-06 1.52683e-05 1.92193e-05 1.67806e-05 1.54805e-05 1.48031e-05 1.4317e-05 1.38198e-05
-          1.33348e-05 1.29665e-05 5.32541e-06 1.52151e-05 2.4885e-05 3.85803e-05 3.52117e-05 3.32638e-05 3.17919e-05 3.05887e-05 2.96119e-05 2.89324e-05
-          5.18452e-06 1.48125e-05 2.47983e-05 3.8723e-05 4.1186e-05 5.94111e-05 6.31021e-05 6.51182e-05 6.28518e-05 6.14583e-05 4.30594e-06 1.23024e-05
-          2.41498e-05 3.85884e-05 4.10428e-05 5.93841e-05 6.30734e-05 6.50886e-05 6.61102e-05 6.65626e-05 1.87384e-06 5.3537e-06 2.012e-05 3.75875e-05
-          3.99783e-05 5.91778e-05 6.28544e-05 6.48625e-05 6.58806e-05 6.63315e-05 3.53231e-07 1.00921e-06 8.85638e-06 3.13838e-05 3.33799e-05 5.7652e-05
-          6.12337e-05 6.31901e-05 6.41819e-05 6.46211e-05 4.93109e-08 1.40885e-07 1.68633e-06 1.39263e-05 1.48121e-05 4.82106e-05 5.12057e-05 5.28417e-05
-          5.36711e-05 5.40384e-05 6.55855e-09 1.87382e-08 2.36391e-07 2.67079e-06 2.84066e-06 2.15156e-05 2.28523e-05 2.35825e-05 2.39526e-05 2.41165e-05
-          8.67886e-10 2.47961e-09 3.15077e-08 3.7551e-07 3.99395e-07 4.14748e-06 4.40515e-06 4.54589e-06 4.61724e-06 4.64884e-06 1.14895e-10 3.28262e-10
-          4.17513e-09 5.01263e-08 5.33146e-08 5.84378e-07 6.20683e-07 6.40514e-07 6.50567e-07 6.55019e-07
+          8.74748e-14 2.10483e-13 8.94985e-14 6.75651e-14 5.78437e-14 5.22942e-14 4.87824e-14 4.60229e-14 4.35916e-14 4.17409e-14 1.14535e-11 2.7655e-11
+          1.18811e-11 8.97337e-12 7.68408e-12 6.948e-12 6.48207e-12 6.11582e-12 5.79309e-12 5.54766e-12 1.72113e-10 4.19152e-10 1.83854e-10 1.38955e-10
+          1.19033e-10 1.07657e-10 1.00453e-10 9.47857e-11 8.97916e-11 8.60014e-11 1.34721e-09 3.32151e-09 1.49951e-09 1.13463e-09 9.72469e-10 8.79852e-10
+          8.21157e-10 7.74931e-10 7.34191e-10 7.0336e-10 7.65701e-09 1.92146e-08 9.0259e-09 6.84477e-09 5.87157e-09 5.31535e-09 4.96246e-09 4.68406e-09
+          4.43863e-09 4.25362e-09 3.56696e-08 9.17816e-08 4.55092e-08 3.46805e-08 2.97987e-08 2.70025e-08 2.5225e-08 2.38185e-08 2.25777e-08 2.16471e-08
+          1.42655e-07 3.79863e-07 2.02407e-07 1.56001e-07 1.34539e-07 1.22167e-07 1.1427e-07 1.07984e-07 1.02427e-07 9.82844e-08 4.92616e-07 1.36928e-06
+          7.99404e-07 6.3128e-07 5.49099e-07 5.00959e-07 4.69951e-07 4.44956e-07 4.22728e-07 4.0624e-07 1.43811e-06 4.18808e-06 2.72388e-06 2.24527e-06
+          1.9857e-06 1.82887e-06 1.7262e-06 1.64118e-06 1.56454e-06 1.50771e-06 3.56481e-06 1.08029e-05 7.78599e-06 6.73133e-06 6.11086e-06 5.71076e-06
+          5.44064e-06 5.20557e-06 4.98949e-06 4.82857e-06 5.34402e-06 1.52682e-05 1.9219e-05 1.67804e-05 1.54803e-05 1.48029e-05 1.43168e-05 1.38196e-05
+          1.33346e-05 1.29663e-05 5.32537e-06 1.5215e-05 2.48848e-05 3.85799e-05 3.52113e-05 3.32634e-05 3.17915e-05 3.05883e-05 2.96115e-05 2.8932e-05
+          5.18448e-06 1.48124e-05 2.47981e-05 3.87227e-05 4.11856e-05 5.94105e-05 6.31016e-05 6.51178e-05 6.2851e-05 6.14576e-05 4.30591e-06 1.23023e-05
+          2.41497e-05 3.85881e-05 4.10424e-05 5.93835e-05 6.30729e-05 6.50882e-05 6.61099e-05 6.65624e-05 1.87383e-06 5.35366e-06 2.01198e-05 3.75872e-05
+          3.99779e-05 5.91773e-05 6.28539e-05 6.48622e-05 6.58803e-05 6.63313e-05 3.53228e-07 1.0092e-06 8.85632e-06 3.13835e-05 3.33796e-05 5.76514e-05
+          6.12332e-05 6.31897e-05 6.41816e-05 6.46209e-05 4.93106e-08 1.40884e-07 1.68632e-06 1.39262e-05 1.4812e-05 4.82101e-05 5.12053e-05 5.28414e-05
+          5.36709e-05 5.40382e-05 6.5585e-09 1.87381e-08 2.36389e-07 2.67077e-06 2.84064e-06 2.15154e-05 2.28522e-05 2.35823e-05 2.39525e-05 2.41165e-05
+          8.6788e-10 2.47959e-09 3.15075e-08 3.75507e-07 3.99391e-07 4.14744e-06 4.40512e-06 4.54587e-06 4.61722e-06 4.64883e-06 1.14894e-10 3.2826e-10
+          4.1751e-09 5.01259e-08 5.33141e-08 5.84372e-07 6.20678e-07 6.4051e-07 6.50564e-07 6.55017e-07
         </DataArray>
         <DataArray type="Float32" Name="dv_x/dx_" NumberOfComponents="3" format="ascii">
-          -0.0828753 4.15982 0 -0.041669 6.45468 0 -0.000286459 4.20771 0 -8.2397e-05 3.65563 0
-          -4.39067e-05 3.38228 0 -2.75913e-05 3.21586 0 -1.98684e-05 3.10594 0 -1.69577e-05 3.01677 0
-          -1.43661e-05 2.93596 0 -1.26082e-05 2.87293 0 -0.0817769 4.09999 0 -0.0416575 6.39329 0
-          -0.000956341 4.20497 0 -0.000279942 3.6534 0 -0.000149156 3.3803 0 -9.37265e-05 3.21406 0
-          -6.75153e-05 3.10425 0 -5.76392e-05 3.01511 0 -4.87917e-05 2.93432 0 -4.2779e-05 2.87144 0
-          -0.0802408 3.97542 0 -0.0416087 6.26522 0 -0.0018602 4.1989 0 -0.000556068 3.6486 0
-          -0.000296251 3.37606 0 -0.00018615 3.21023 0 -0.000134147 3.10064 0 -0.000114559 3.01156 0
-          -9.6883e-05 2.93084 0 -8.48441e-05 2.86828 0 -0.0780942 3.80599 0 -0.0414778 6.08988 0
-          -0.00306045 4.18912 0 -0.000941612 3.64144 0 -0.000501656 3.36983 0 -0.000315204 3.20464 0
-          -0.000227279 3.09537 0 -0.000194175 3.0064 0 -0.000164003 2.9258 0 -0.000143392 2.86369 0
-          -0.0750985 3.57752 0 -0.0411774 5.84959 0 -0.00461662 4.17076 0 -0.00147842 3.62954 0
-          -0.000787997 3.35978 0 -0.000495126 3.19572 0 -0.000357313 3.08706 0 -0.000305464 2.99834 0
-          -0.000257544 2.91794 0 -0.000224673 2.85652 0 -0.0709322 3.2717 0 -0.0405428 5.51583 0
-          -0.00655948 4.12919 0 -0.00221979 3.60542 0 -0.0011854 3.34029 0 -0.000745038 3.17871 0
-          -0.000538372 3.07144 0 -0.00046072 2.98341 0 -0.000387523 2.9036 0 -0.000337023 2.84328 0
-          -0.065195 2.86537 0 -0.0392853 5.03781 0 -0.00883201 4.02288 0 -0.00321917 3.54508 0
-          -0.00172954 3.29291 0 -0.00108835 3.13792 0 -0.000788257 3.03443 0 -0.000675817 2.94865 0
-          -0.00056676 2.87066 0 -0.000490883 2.81249 0 -0.0575102 2.33964 0 -0.0369671 4.33979 0
-          -0.0111708 3.75847 0 -0.00447481 3.3836 0 -0.00244317 3.165 0 -0.00154351 3.02734 0
-          -0.00112304 2.93418 0 -0.000966631 2.85519 0 -0.000808163 2.7827 0 -0.000696434 2.72933 0
-          -0.0478944 1.71429 0 -0.0331491 3.38064 0 -0.0129674 3.21645 0 -0.00578583 3.01038 0
-          -0.0032703 2.85703 0 -0.0020866 2.75513 0 -0.00153277 2.68432 0 -0.00133093 2.62096 0
-          -0.00111107 2.56142 0 -0.00095249 2.51795 0 -0.0373315 1.1235 0 -0.0278719 2.3521 0
-          -0.0134126 2.4334 0 -0.00665102 2.37569 0 -0.00398865 2.30773 0 -0.0025892 2.25395 0
-          -0.00193544 2.21386 0 -0.00171078 2.17314 0 -0.00143185 2.13333 0 -0.00122281 2.10442 0
-          -0.0270656 0.684106 0 -0.0220455 1.52795 0 -0.0127675 1.67408 0 -0.00685111 1.63847 0
-          -0.00430225 1.61108 0 -0.00288235 1.60614 0 -0.00221776 1.59886 0 -0.0020135 1.58119 0
-          -0.00169355 1.56062 0 -0.00144261 1.54528 0 -0.0173032 0.383738 0 -0.0161236 0.942162 0
-          -0.0121011 1.12111 0 -0.00739864 1.09974 0 -0.00437226 1.06431 0 -0.00273427 1.0448 0
-          -0.00223158 1.02552 0 -0.00216456 1.00905 0 -0.00185794 0.997486 0 -0.00158691 0.991093 0
-          -0.00850996 0.185549 0 -0.00979459 0.515606 0 -0.0101495 0.711753 0 -0.00779489 0.767605 0
-          -0.00521505 0.755918 0 -0.00352685 0.717114 0 -0.0028117 0.679782 0 -0.00247922 0.657306 0
-          -0.00199185 0.645604 0 -0.00165504 0.640838 0 -0.001949 0.0729507 0 -0.00388411 0.231401 0
-          -0.00623962 0.379992 0 -0.00637135 0.476874 0 -0.00554669 0.518425 0 -0.0045052 0.520669 0
-          -0.0036227 0.509672 0 -0.00295953 0.499861 0 -0.002241 0.492551 0 -0.00180864 0.488662 0
-          0.00180955 0.0214952 0 0.000203874 0.0790016 0 -0.00215591 0.154401 0 -0.00328699 0.227418 0
-          -0.00378893 0.284959 0 -0.00381188 0.323231 0 -0.0034893 0.346073 0 -0.00303672 0.359526 0
-          -0.00235652 0.367425 0 -0.00190833 0.371777 0 0.00329437 0.00346195 0 0.00217497 0.0174259 0
-          0.000526587 0.043265 0 -0.000419261 0.0762391 0 -0.00117864 0.11163 0 -0.00171906 0.14542 0
-          -0.00196799 0.174699 0 -0.00198607 0.198618 0 -0.00168251 0.217684 0 -0.0014119 0.229975 0
-          0.00359206 -0.000884025 0 0.00274431 0.000344079 0 0.00159785 0.0060598 0 0.00107643 0.0149651 0
-          0.000626573 0.0271142 0 0.000213541 0.0419974 0 -9.39492e-05 0.0582565 0 -0.000293193 0.0744676 0
-          -0.000355123 0.0897212 0 -0.000339409 0.100574 0 0.00351384 -0.00125838 0 0.00279544 -0.00210378 0
-          0.00183305 -0.00118112 0 0.00146206 0.000139471 0 0.00123684 0.00229691 0 0.00106367 0.00568901 0
-          0.000933404 0.0102254 0 0.000825469 0.0155349 0 0.000650192 0.0212025 0 0.000527537 0.0255919 0
-          0.00338055 -0.000903697 0 0.00275398 -0.00173871 0 0.00187848 -0.00167423 0 0.00151152 -0.00171208 0
-          0.00132081 -0.00174481 0 0.00120537 -0.00165221 0 0.00113774 -0.00138528 0 0.00108002 -0.000951437 0
-          0.000902987 -0.000426657 0 0.000758802 6.3584e-05 0 0.00322136 -0.000747829 0 0.00266049 -0.00152691 0
-          0.00183772 -0.00166291 0 0.0014497 -0.00192589 0 0.00124733 -0.00226798 0 0.00112664 -0.00264515 0
-          0.00105614 -0.00303869 0 0.000993358 -0.00344396 0 0.000827959 -0.00388693 0 0.000699255 -0.00417836 0
+          -0.0828753 4.15977 0 -0.041669 6.4546 0 -0.000286456 4.20766 0 -8.23964e-05 3.65559 0
+          -4.39064e-05 3.38224 0 -2.7591e-05 3.21582 0 -1.98682e-05 3.10591 0 -1.69576e-05 3.01673 0
+          -1.4366e-05 2.93592 0 -1.26081e-05 2.87289 0 -0.0817769 4.09994 0 -0.0416575 6.39322 0
+          -0.00095633 4.20492 0 -0.00027994 3.65336 0 -0.000149155 3.38026 0 -9.37258e-05 3.21403 0
+          -6.75147e-05 3.10421 0 -5.76386e-05 3.01507 0 -4.87912e-05 2.93429 0 -4.27786e-05 2.87141 0
+          -0.0802409 3.97537 0 -0.0416087 6.26515 0 -0.00186018 4.19885 0 -0.000556064 3.64856 0
+          -0.000296249 3.37602 0 -0.000186149 3.2102 0 -0.000134146 3.1006 0 -0.000114558 3.01152 0
+          -9.68821e-05 2.93081 0 -8.48433e-05 2.86825 0 -0.0780943 3.80595 0 -0.0414778 6.08981 0
+          -0.00306042 4.18907 0 -0.000941605 3.6414 0 -0.000501653 3.36979 0 -0.000315201 3.2046 0
+          -0.000227277 3.09534 0 -0.000194174 3.00637 0 -0.000164002 2.92576 0 -0.000143391 2.86366 0
+          -0.0750986 3.57748 0 -0.0411774 5.84952 0 -0.00461657 4.17071 0 -0.0014784 3.6295 0
+          -0.000787991 3.35974 0 -0.000495123 3.19568 0 -0.00035731 3.08703 0 -0.000305462 2.9983 0
+          -0.000257541 2.91791 0 -0.000224671 2.85648 0 -0.0709324 3.27166 0 -0.0405428 5.51577 0
+          -0.0065594 4.12915 0 -0.00221977 3.60538 0 -0.0011854 3.34025 0 -0.000745032 3.17868 0
+          -0.000538367 3.07141 0 -0.000460715 2.98338 0 -0.000387519 2.90356 0 -0.00033702 2.84324 0
+          -0.0651952 2.86534 0 -0.0392853 5.03776 0 -0.00883191 4.02284 0 -0.00321914 3.54504 0
+          -0.00172953 3.29287 0 -0.00108834 3.13788 0 -0.00078825 3.0344 0 -0.000675811 2.94862 0
+          -0.000566754 2.87063 0 -0.000490878 2.81245 0 -0.0575105 2.33962 0 -0.0369671 4.33975 0
+          -0.0111707 3.75843 0 -0.00447478 3.38356 0 -0.00244315 3.16496 0 -0.0015435 3.02731 0
+          -0.00112303 2.93415 0 -0.000966622 2.85516 0 -0.000808156 2.78267 0 -0.000696427 2.7293 0
+          -0.0478947 1.71428 0 -0.0331492 3.38062 0 -0.0129672 3.21642 0 -0.00578579 3.01036 0
+          -0.00327028 2.857 0 -0.00208659 2.75511 0 -0.00153275 2.6843 0 -0.00133092 2.62093 0
+          -0.00111106 2.56139 0 -0.000952481 2.51793 0 -0.037332 1.1235 0 -0.027872 2.35209 0
+          -0.0134125 2.43339 0 -0.00665098 2.37567 0 -0.00398863 2.30771 0 -0.00258918 2.25393 0
+          -0.00193542 2.21384 0 -0.00171076 2.17312 0 -0.00143183 2.13332 0 -0.0012228 2.10441 0
+          -0.027066 0.684103 0 -0.0220457 1.52794 0 -0.0127674 1.67407 0 -0.00685108 1.63846 0
+          -0.00430224 1.61108 0 -0.00288234 1.60613 0 -0.00221774 1.59885 0 -0.00201348 1.58118 0
+          -0.00169353 1.56061 0 -0.0014426 1.54527 0 -0.0173037 0.383737 0 -0.0161238 0.942159 0
+          -0.012101 1.12111 0 -0.0073986 1.09973 0 -0.00437224 1.0643 0 -0.00273426 1.04479 0
+          -0.00223157 1.02551 0 -0.00216455 1.00904 0 -0.00185792 0.997482 0 -0.00158689 0.991089 0
+          -0.00851054 0.185549 0 -0.00979482 0.515604 0 -0.0101494 0.71175 0 -0.00779484 0.767602 0
+          -0.00521503 0.755915 0 -0.00352683 0.71711 0 -0.00281168 0.679778 0 -0.00247919 0.657303 0
+          -0.00199182 0.645602 0 -0.00165501 0.640836 0 -0.00194959 0.0729509 0 -0.00388437 0.231401 0
+          -0.00623957 0.379991 0 -0.00637132 0.476872 0 -0.00554667 0.518422 0 -0.00450519 0.520666 0
+          -0.00362267 0.509669 0 -0.00295949 0.499858 0 -0.00224096 0.492549 0 -0.00180861 0.48866 0
+          0.00180896 0.0214945 0 0.000203596 0.079 0 -0.0021559 0.154399 0 -0.003287 0.227415 0
+          -0.00378892 0.284956 0 -0.00381186 0.323228 0 -0.00348927 0.346071 0 -0.00303668 0.359525 0
+          -0.00235647 0.367425 0 -0.00190829 0.371777 0 0.0032937 0.00345492 0 0.00217465 0.0174138 0
+          0.000526598 0.0432563 0 -0.000419262 0.0762333 0 -0.00117861 0.111627 0 -0.001719 0.14542 0
+          -0.00196791 0.174702 0 -0.00198598 0.198622 0 -0.00168243 0.217689 0 -0.00141183 0.229981 0
+          0.00359081 -0.000856639 0 0.00274393 0.000396493 0 0.00159827 0.00610773 0 0.00107678 0.015009 0
+          0.000626933 0.0271544 0 0.000213885 0.0420337 0 -9.36632e-05 0.058289 0 -0.000292973 0.0744967 0
+          -0.000354967 0.0897473 0 -0.000339288 0.100598 0 0.00351764 -0.00126191 0 0.00279696 -0.0021112 0
+          0.00183231 -0.00118887 0 0.00146137 0.000131695 0 0.00123619 0.00228894 0 0.00106304 0.00568069 0
+          0.00093284 0.0102168 0 0.000824985 0.0155261 0 0.000649823 0.0211937 0 0.000527244 0.0255831 0
+          0.00337832 -0.000916814 0 0.00275307 -0.00176419 0 0.00187885 -0.00169791 0 0.00151185 -0.00173379 0
+          0.0013211 -0.00176469 0 0.00120564 -0.00167029 0 0.00113798 -0.00140168 0 0.00108021 -0.00096639 0
+          0.000903131 -0.000440383 0 0.000758913 5.06693e-05 0 0.00322083 -0.000737998 0 0.00266016 -0.00150879 0
+          0.00183763 -0.00164739 0 0.00144967 -0.00191228 0 0.00124731 -0.00225597 0 0.00112662 -0.00263458 0
+          0.00105612 -0.00302941 0 0.000993343 -0.00343581 0 0.000827947 -0.00387971 0 0.000699246 -0.00417173 0
         </DataArray>
         <DataArray type="Float32" Name="dv_y/dx_" NumberOfComponents="3" format="ascii">
-          -3.27486e-05 0.162655 0 -1.64362e-05 0.00181432 0 -7.02984e-08 0.000365844 0 -1.1097e-08 0.000162884 0
-          -4.25585e-09 9.89143e-05 0 -2.25199e-09 6.04958e-05 0 -8.28475e-10 4.47748e-05 0 -3.3252e-10 4.06043e-05 0
-          -7.01202e-10 3.67708e-05 0 -1.08401e-09 2.36449e-05 0 -0.000109735 0.159837 0 -5.5276e-05 0.00305321 0
-          -4.6553e-07 0.000628654 0 -7.498e-08 0.000279904 0 -2.87599e-08 0.000169959 0 -1.52089e-08 0.000103924 0
-          -5.58901e-09 7.69706e-05 0 -2.24808e-09 6.98013e-05 0 -4.76002e-09 6.32067e-05 0 -7.36675e-09 4.0503e-05 0
-          -0.000212855 0.154001 0 -0.000107882 0.00555308 0 -1.66323e-06 0.00118337 0 -2.74562e-07 0.000526989 0
-          -1.05336e-07 0.000319942 0 -5.56629e-08 0.000195562 0 -2.04278e-08 0.000145007 0 -8.23825e-09 0.000131502 0
-          -1.75296e-08 0.000119064 0 -2.71651e-08 7.58636e-05 0 -0.000348479 0.146153 0 -0.000178162 0.00874183 0
-          -4.50717e-06 0.00195636 0 -7.69289e-07 0.000871872 0 -2.95271e-07 0.000529255 0 -1.55879e-07 0.000323342 0
-          -5.7102e-08 0.00024015 0 -2.31101e-08 0.00021779 0 -4.95007e-08 0.000197159 0 -7.68443e-08 0.000124613 0
-          -0.000522247 0.135775 0 -0.000270217 0.0126268 0 -1.05231e-05 0.00302585 0 -1.88118e-06 0.00135174 0
-          -7.22863e-07 0.000820641 0 -3.81134e-07 0.000501029 0 -1.39257e-07 0.000373017 0 -5.66366e-08 0.000338329 0
-          -1.22428e-07 0.000306219 0 -1.90509e-07 0.000191365 0 -0.000736667 0.122388 0 -0.000387388 0.0170187 0
-          -2.22778e-05 0.00447508 0 -4.24492e-06 0.00201303 0 -1.63608e-06 0.00122344 0 -8.6138e-07 0.000746361 0
-          -3.13535e-07 0.000557722 0 -1.2839e-07 0.00050607 0 -2.8113e-07 0.000457973 0 -4.38887e-07 0.000281773 0
-          -0.00098725 0.105774 0 -0.000530396 0.021378 0 -4.36337e-05 0.00632897 0 -9.05606e-06 0.00289728 0
-          -3.51782e-06 0.00176821 0 -1.85007e-06 0.00107793 0 -6.6947e-07 0.000810439 0 -2.76735e-07 0.000736372 0
-          -6.17348e-07 0.000666543 0 -9.68097e-07 0.000401688 0 -0.00125809 0.0863907 0 -0.00069459 0.0247539 0
-          -7.93677e-05 0.00838294 0 -1.83338e-05 0.00398452 0 -7.25633e-06 0.00245974 0 -3.82008e-06 0.00149894 0
-          -1.36866e-06 0.00113956 0 -5.72908e-07 0.00103932 0 -1.31502e-06 0.000942226 0 -2.07525e-06 0.00055353 0
-          -0.00152039 0.0658245 0 -0.000867766 0.0261145 0 -0.000133458 0.0100114 0 -3.46728e-05 0.00509046 0
-          -1.42675e-05 0.00321813 0 -7.55962e-06 0.00195785 0 -2.65723e-06 0.00151953 0 -1.13015e-06 0.00139772 0
-          -2.7183e-06 0.00127278 0 -4.33018e-06 0.000727258 0 -0.00173896 0.0462188 0 -0.00103252 0.0251254 0
-          -0.000206663 0.0107525 0 -5.94657e-05 0.00583276 0 -2.62235e-05 0.00385757 0 -1.41047e-05 0.00233469 0
-          -4.7601e-06 0.00187982 0 -2.0669e-06 0.00175206 0 -5.3745e-06 0.00160742 0 -8.68126e-06 0.000893925 0
-          -0.00187799 0.0290482 0 -0.0011684 0.0220036 0 -0.000296994 0.0111123 0 -9.31188e-05 0.00638266 0
-          -4.39193e-05 0.0041331 0 -2.43243e-05 0.00243766 0 -7.59599e-06 0.00211586 0 -3.43918e-06 0.00202443 0
-          -9.99244e-06 0.00188468 0 -1.64263e-05 0.00102243 0 -0.00190616 0.0151415 0 -0.00124537 0.0168703 0
-          -0.000392042 0.0111102 0 -0.00014229 0.00712017 0 -7.30401e-05 0.00440317 0 -3.80439e-05 0.00266104 0
-          -9.66409e-06 0.00239345 0 -4.81039e-06 0.0022584 0 -1.72655e-05 0.00207137 0 -2.91464e-05 0.00109871 0
-          -0.00182054 0.00513919 0 -0.00123538 0.0104688 0 -0.000458986 0.0094518 0 -0.00020455 0.00725905 0
-          -0.000118004 0.00499689 0 -5.77143e-05 0.00347351 0 -1.42856e-05 0.00294472 0 -8.79024e-06 0.00258484 0
-          -2.92599e-05 0.00223771 0 -4.87465e-05 0.00115325 0 -0.00165823 -0.000911338 0 -0.00114506 0.00452954 0
-          -0.000466701 0.00592899 0 -0.000245911 0.00572778 0 -0.000161091 0.00489126 0 -8.5777e-05 0.00405364 0
-          -3.03346e-05 0.00339916 0 -2.12554e-05 0.00289407 0 -5.05643e-05 0.00242234 0 -7.95957e-05 0.00120946 0
-          -0.00146619 -0.003811 0 -0.00101263 0.000486351 0 -0.000419967 0.00217869 0 -0.000238343 0.00296465 0
-          -0.000172521 0.0032786 0 -0.000106303 0.00330164 0 -5.20458e-05 0.00299855 0 -4.05993e-05 0.00268041 0
-          -8.41173e-05 0.00230384 0 -0.000127739 0.00114036 0 -0.0012664 -0.00476899 0 -0.000871997 -0.00150853 0
-          -0.000353717 -0.000321712 0 -0.000195767 0.000450341 0 -0.000145728 0.00105376 0 -9.8544e-05 0.0015123 0
-          -5.86559e-05 0.00162075 0 -5.29269e-05 0.00162384 0 -0.000120774 0.00150126 0 -0.000185681 0.000765024 0
-          -0.00104999 -0.00480827 0 -0.000728782 -0.00221397 0 -0.000294941 -0.00140997 0 -0.000150553 -0.000933684 0
-          -0.000104741 -0.000514583 0 -7.01146e-05 -0.000120469 0 -4.49263e-05 8.63239e-05 0 -4.82257e-05 0.000226692 0
-          -0.000138932 0.000286049 0 -0.00022172 0.000175157 0 -0.000802772 -0.0045461 0 -0.000568341 -0.0024113 0
-          -0.000239316 -0.00171439 0 -0.000115759 -0.00139061 0 -7.30629e-05 -0.00115215 0 -4.48498e-05 -0.00094295 0
-          -2.76353e-05 -0.000819134 0 -3.50803e-05 -0.000717086 0 -0.000125379 -0.000618187 0 -0.000205498 -0.000293252 0
-          -0.000515874 -0.00423819 0 -0.000374542 -0.00246186 0 -0.000167255 -0.00175656 0 -8.02174e-05 -0.0014519 0
-          -4.87402e-05 -0.00126724 0 -2.84555e-05 -0.00113853 0 -1.66713e-05 -0.00107161 0 -2.30877e-05 -0.00101624 0
-          -8.59112e-05 -0.000921254 0 -0.000140423 -0.000475524 0 -0.000180573 -0.00411034 0 -0.000133718 -0.00246933 0
-          -6.24341e-05 -0.00175308 0 -3.00607e-05 -0.00144331 0 -1.81817e-05 -0.00126213 0 -1.05886e-05 -0.0011442 0
-          -6.21724e-06 -0.00108724 0 -8.74757e-06 -0.00104187 0 -3.06803e-05 -0.000946877 0 -4.93712e-05 -0.000501256 0
+          -3.27486e-05 0.162655 0 -1.64362e-05 0.0018143 0 -7.02975e-08 0.000365841 0 -1.10969e-08 0.000162882 0
+          -4.25582e-09 9.89135e-05 0 -2.25197e-09 6.04954e-05 0 -8.28473e-10 4.47743e-05 0 -3.32514e-10 4.06039e-05 0
+          -7.01197e-10 3.67705e-05 0 -1.084e-09 2.36446e-05 0 -0.000109735 0.159837 0 -5.5276e-05 0.00305317 0
+          -4.65523e-07 0.000628649 0 -7.49794e-08 0.000279902 0 -2.87596e-08 0.000169958 0 -1.52089e-08 0.000103923 0
+          -5.589e-09 7.69698e-05 0 -2.24804e-09 6.98007e-05 0 -4.75999e-09 6.32061e-05 0 -7.36671e-09 4.05026e-05 0
+          -0.000212855 0.154001 0 -0.000107882 0.005553 0 -1.66321e-06 0.00118336 0 -2.7456e-07 0.000526985 0
+          -1.05335e-07 0.000319939 0 -5.56626e-08 0.000195561 0 -2.04277e-08 0.000145006 0 -8.2381e-09 0.000131501 0
+          -1.75295e-08 0.000119063 0 -2.7165e-08 7.58628e-05 0 -0.000348479 0.146153 0 -0.000178162 0.00874171 0
+          -4.50711e-06 0.00195635 0 -7.69283e-07 0.000871865 0 -2.95269e-07 0.000529251 0 -1.55879e-07 0.00032334 0
+          -5.71019e-08 0.000240147 0 -2.31097e-08 0.000217788 0 -4.95003e-08 0.000197157 0 -7.68439e-08 0.000124611 0
+          -0.000522248 0.135775 0 -0.000270217 0.0126266 0 -1.0523e-05 0.00302582 0 -1.88116e-06 0.00135173 0
+          -7.22857e-07 0.000820635 0 -3.81132e-07 0.000501026 0 -1.39256e-07 0.000373013 0 -5.66355e-08 0.000338325 0
+          -1.22427e-07 0.000306216 0 -1.90508e-07 0.000191363 0 -0.000736669 0.122388 0 -0.000387389 0.0170185 0
+          -2.22775e-05 0.00447504 0 -4.24488e-06 0.00201302 0 -1.63607e-06 0.00122343 0 -8.61376e-07 0.000746356 0
+          -3.13534e-07 0.000557716 0 -1.28388e-07 0.000506065 0 -2.81127e-07 0.000457969 0 -4.38884e-07 0.00028177 0
+          -0.000987254 0.105775 0 -0.000530398 0.0213777 0 -4.36331e-05 0.00632891 0 -9.05598e-06 0.00289725 0
+          -3.51779e-06 0.0017682 0 -1.85006e-06 0.00107792 0 -6.69469e-07 0.000810431 0 -2.7673e-07 0.000736365 0
+          -6.17343e-07 0.000666537 0 -9.68091e-07 0.000401683 0 -0.0012581 0.0863916 0 -0.000694593 0.0247536 0
+          -7.93666e-05 0.00838287 0 -1.83337e-05 0.00398449 0 -7.25627e-06 0.00245972 0 -3.82007e-06 0.00149893 0
+          -1.36866e-06 0.00113954 0 -5.72898e-07 0.00103931 0 -1.31501e-06 0.000942218 0 -2.07523e-06 0.000553524 0
+          -0.0015204 0.0658255 0 -0.000867772 0.0261142 0 -0.000133456 0.0100114 0 -3.46725e-05 0.00509043 0
+          -1.42674e-05 0.00321811 0 -7.55959e-06 0.00195784 0 -2.65723e-06 0.00151951 0 -1.13013e-06 0.00139771 0
+          -2.71828e-06 0.00127277 0 -4.33016e-06 0.00072725 0 -0.00173898 0.0462199 0 -0.00103253 0.0251251 0
+          -0.00020666 0.0107524 0 -5.94652e-05 0.00583273 0 -2.62234e-05 0.00385755 0 -1.41046e-05 0.00233468 0
+          -4.7601e-06 0.0018798 0 -2.06686e-06 0.00175205 0 -5.37446e-06 0.00160741 0 -8.68122e-06 0.000893915 0
+          -0.00187803 0.0290495 0 -0.00116842 0.0220034 0 -0.00029699 0.0111123 0 -9.31181e-05 0.00638263 0
+          -4.39191e-05 0.00413308 0 -2.43243e-05 0.00243765 0 -7.59601e-06 0.00211584 0 -3.43911e-06 0.00202441 0
+          -9.99238e-06 0.00188466 0 -1.64262e-05 0.00102241 0 -0.00190622 0.0151427 0 -0.0012454 0.0168701 0
+          -0.000392036 0.0111101 0 -0.000142289 0.00712014 0 -7.30397e-05 0.00440315 0 -3.80439e-05 0.00266103 0
+          -9.66415e-06 0.00239343 0 -4.81025e-06 0.00225838 0 -1.72655e-05 0.00207135 0 -2.91463e-05 0.00109869 0
+          -0.00182063 0.00514049 0 -0.00123542 0.0104687 0 -0.000458979 0.00945174 0 -0.000204549 0.00725901 0
+          -0.000118004 0.00499687 0 -5.77143e-05 0.0034735 0 -1.42858e-05 0.0029447 0 -8.79013e-06 0.00258481 0
+          -2.92597e-05 0.00223768 0 -4.87463e-05 0.00115323 0 -0.00165835 -0.00091004 0 -0.00114512 0.00452943 0
+          -0.000466693 0.00592896 0 -0.000245909 0.00572776 0 -0.00016109 0.00489125 0 -8.57771e-05 0.00405362 0
+          -3.03351e-05 0.00339914 0 -2.12556e-05 0.00289403 0 -5.0564e-05 0.00242229 0 -7.9595e-05 0.00120943 0
+          -0.00146637 -0.00380957 0 -0.00101271 0.00048626 0 -0.000419957 0.0021787 0 -0.00023834 0.00296465 0
+          -0.00017252 0.00327858 0 -0.000106303 0.00330161 0 -5.20468e-05 0.00299851 0 -4.06e-05 0.00268035 0
+          -8.41167e-05 0.00230378 0 -0.000127737 0.00114033 0 -0.00126667 -0.00476528 0 -0.000872119 -0.00150878 0
+          -0.000353705 -0.000321833 0 -0.000195766 0.00045023 0 -0.000145729 0.00105362 0 -9.85456e-05 0.00151214 0
+          -5.86576e-05 0.00162061 0 -5.2928e-05 0.00162372 0 -0.000120773 0.00150115 0 -0.000185677 0.000764971 0
+          -0.00105067 -0.00481465 0 -0.000729108 -0.00221401 0 -0.000294922 -0.00140989 0 -0.000150552 -0.000933622 0
+          -0.000104744 -0.000514542 0 -7.01153e-05 -0.000120437 0 -4.49252e-05 8.63634e-05 0 -4.82245e-05 0.000226736 0
+          -0.000138927 0.000286089 0 -0.000221711 0.000175176 0 -0.000801902 -0.00455471 0 -0.000567885 -0.00241117 0
+          -0.000239295 -0.00171421 0 -0.000115762 -0.00139045 0 -7.30662e-05 -0.00115199 0 -4.48516e-05 -0.000942789 0
+          -2.76359e-05 -0.000818988 0 -3.50815e-05 -0.000716955 0 -0.00012538 -0.000618073 0 -0.000205498 -0.000293199 0
+          -0.000514373 -0.00423599 0 -0.00037377 -0.00246185 0 -0.000167234 -0.0017566 0 -8.02189e-05 -0.00145193 0
+          -4.87417e-05 -0.00126726 0 -2.84577e-05 -0.00113854 0 -1.6674e-05 -0.00107162 0 -2.30904e-05 -0.00101625 0
+          -8.59156e-05 -0.000921255 0 -0.000140429 -0.000475523 0 -0.000180467 -0.00410355 0 -0.000133653 -0.00246936 0
+          -6.24218e-05 -0.00175321 0 -3.00592e-05 -0.00144343 0 -1.81813e-05 -0.00126224 0 -1.05884e-05 -0.0011443 0
+          -6.21714e-06 -0.00108733 0 -8.74736e-06 -0.00104195 0 -3.06797e-05 -0.000946934 0 -4.93704e-05 -0.00050128 0
         </DataArray>
         <DataArray type="Float32" Name="velocity_gas (m/s)" NumberOfComponents="3" format="ascii">
-          0.0505067 1.97417e-05 0 0.000781519 9.24843e-08 0 0.000503898 1.82517e-08 0 0.000437768 8.12616e-09 0
-          0.000405022 4.93534e-09 0 0.00038508 3.01914e-09 0 0.000371913 2.23296e-09 0 0.000361238 2.02497e-09 0
-          0.000351563 1.83394e-09 0 0.000343998 1.18353e-09 0 0.0517014 6.64546e-05 0 0.00263524 6.13541e-07 0
-          0.00171231 1.23319e-07 0 0.00148763 5.49048e-08 0 0.00137638 3.33426e-08 0 0.00130864 2.0393e-08 0
-          0.00126391 1.50919e-08 0 0.00122762 1.36862e-08 0 0.00119474 1.23942e-08 0 0.00116907 7.97413e-09 0
-          0.0533326 0.00012991 0 0.00518814 2.19693e-06 0 0.0034022 4.51556e-07 0 0.0029559 2.01052e-07 0
-          0.00273492 1.22081e-07 0 0.0026004 7.46494e-08 0 0.00251154 5.52855e-08 0 0.00243942 5.01361e-08 0
-          0.00237407 4.53997e-08 0 0.00232316 2.91006e-08 0 0.0555375 0.000215059 0 0.00868092 5.97204e-06 0
-          0.00576408 1.26522e-06 0 0.00500838 5.63428e-07 0 0.00463414 3.42073e-07 0 0.00440639 2.09103e-07 0
-          0.0042559 1.55018e-07 0 0.00413365 1.40581e-07 0 0.00402289 1.27286e-07 0 0.00393685 8.11796e-08 0
-          0.0584743 0.000327355 0 0.0134152 1.40066e-05 0 0.00906146 3.09449e-06 0 0.00787527 1.3789e-06 0
-          0.00728736 8.37074e-07 0 0.00692968 5.11467e-07 0 0.00669321 3.79714e-07 0 0.0065009 3.44359e-07 0
-          0.00632665 3.11751e-07 0 0.00619185 1.97446e-07 0 0.0623037 0.000471853 0 0.0197444 2.98534e-05 0
-          0.0136523 6.98807e-06 0 0.011873 3.12001e-06 0 0.0109886 1.89417e-06 0 0.0104505 1.15671e-06 0
-          0.0100945 8.60514e-07 0 0.00980447 7.8047e-07 0 0.00954165 7.06447e-07 0 0.00933944 4.43114e-07 0
-          0.0671373 0.00065142 0 0.0280203 5.90695e-05 0 0.0199949 1.49438e-05 0 0.0174219 6.7091e-06 0
-          0.0161319 4.07656e-06 0 0.0153464 2.48772e-06 0 0.0148259 1.85648e-06 0 0.0144005 1.68436e-06 0
-          0.0140149 1.5244e-06 0 0.0137204 9.43539e-07 0 0.0729256 0.000863957 0 0.0384195 0.000109101 0
-          0.0285651 3.04495e-05 0 0.0250146 1.38602e-05 0 0.0231953 8.44891e-06 0 0.0220827 5.15259e-06 0
-          0.0213431 3.86481e-06 0 0.0207351 3.5102e-06 0 0.0201832 3.17732e-06 0 0.0197653 1.93217e-06 0
-          0.0792795 0.00109977 0 0.0505429 0.000187537 0 0.0395006 5.84495e-05 0 0.034982 2.73879e-05 0
-          0.0325576 1.68421e-05 0 0.0310577 1.02669e-05 0 0.0300537 7.77053e-06 0 0.0292184 7.07822e-06 0
-          0.0284566 6.41436e-06 0 0.0278851 3.81625e-06 0 0.0853812 0.00134222 0 0.0629822 0.000298842 0
-          0.0519348 0.00010319 0 0.0468871 5.0846e-05 0 0.0439536 3.18308e-05 0 0.0421007 1.93777e-05 0
-          0.0408466 1.49053e-05 0 0.0397782 1.36656e-05 0 0.0387936 1.2425e-05 0 0.03806 7.21622e-06 0
-          0.0907078 0.00156991 0 0.0744684 0.000443112 0 0.0642531 0.000167824 0 0.0591475 8.67186e-05 0
-          0.0560318 5.60812e-05 0 0.0539848 3.40154e-05 0 0.052573 2.6892e-05 0 0.0513235 2.49002e-05 0
-          0.0501568 2.2765e-05 0 0.0492912 1.29092e-05 0 0.0951234 0.00175589 0 0.0847414 0.00061219 0
-          0.0757751 0.000261438 0 0.0702201 0.00014174 0 0.0668967 9.06893e-05 0 0.0649734 5.40919e-05 0
-          0.0636156 4.50367e-05 0 0.0622955 4.2495e-05 0 0.0610181 3.92643e-05 0 0.060066 2.17764e-05 0
-          0.0983584 0.00187178 0 0.0932524 0.000779457 0 0.0866049 0.000389328 0 0.081073 0.000228674 0
-          0.077251 0.000143868 0 0.074815 8.70688e-05 0 0.0730188 7.46104e-05 0 0.0714409 6.99261e-05 0
-          0.0700437 6.40622e-05 0 0.0690507 3.48142e-05 0 0.100302 0.00189933 0 0.099133 0.000904395 0
-          0.0956414 0.000525256 0 0.0916454 0.000344354 0 0.0879958 0.000230162 0 0.0849894 0.000151044 0
-          0.0825896 0.00012723 0 0.0806422 0.000114643 0 0.0790382 0.000101723 0 0.077953 5.39657e-05 0
-          0.101209 0.00183617 0 0.102295 0.000956457 0 0.101454 0.000621013 0 0.0997077 0.000452497 0
-          0.0975093 0.000335002 0 0.095161 0.000245471 0 0.0929351 0.000207438 0 0.0909738 0.000183017 0
-          0.089291 0.000158719 0 0.088146 8.20757e-05 0 0.101478 0.00169084 0 0.103455 0.000931002 0
-          0.104088 0.000644446 0 0.104087 0.000506542 0 0.103585 0.000409525 0 0.102672 0.000331668 0
-          0.101522 0.000291272 0 0.100311 0.000261281 0 0.099139 0.00022776 0 0.0982919 0.000116352 0
-          0.101474 0.00147091 0 0.103629 0.000840918 0 0.104767 0.000596373 0 0.105547 0.000486988 0
-          0.106059 0.000415709 0 0.106299 0.000361299 0 0.106315 0.000331572 0 0.106186 0.000307387 0
-          0.105964 0.000273701 0 0.10576 0.000140669 0 0.101384 0.00117527 0 0.103492 0.000693606 0
-          0.104738 0.00049326 0 0.105692 0.000406426 0 0.106493 0.000354348 0 0.107176 0.000318751 0
-          0.107769 0.000300529 0 0.108296 0.000285588 0 0.10876 0.000258432 0 0.109076 0.000135133 0
-          0.101285 0.000788464 0 0.103314 0.00047894 0 0.10459 0.000339014 0 0.105568 0.000278234 0
-          0.106404 0.000242753 0 0.107153 0.000219746 0 0.10785 0.000208606 0 0.108518 0.00019974 0
-          0.109146 0.000180901 0 0.109602 9.6647e-05 0 0.101194 0.000284555 0 0.103126 0.000176211 0
-          0.104386 0.000124094 0 0.105332 0.00010129 0 0.106126 8.80213e-05 0 0.106828 7.94723e-05 0
-          0.107478 7.5315e-05 0 0.108096 7.20116e-05 0 0.10867 6.4818e-05 0 0.109089 3.51952e-05 0
+          0.0505067 1.97417e-05 0 0.00078151 9.24831e-08 0 0.000503893 1.82516e-08 0 0.000437763 8.1261e-09 0
+          0.000405018 4.9353e-09 0 0.000385075 3.01912e-09 0 0.000371908 2.23293e-09 0 0.000361234 2.02495e-09 0
+          0.000351559 1.83392e-09 0 0.000343994 1.18352e-09 0 0.0517013 6.64546e-05 0 0.00263521 6.13532e-07 0
+          0.00171229 1.23318e-07 0 0.00148761 5.49044e-08 0 0.00137637 3.33423e-08 0 0.00130863 2.03928e-08 0
+          0.00126389 1.50917e-08 0 0.00122761 1.3686e-08 0 0.00119473 1.23941e-08 0 0.00116906 7.97404e-09 0
+          0.0533326 0.00012991 0 0.00518808 2.1969e-06 0 0.00340216 4.51552e-07 0 0.00295587 2.01051e-07 0
+          0.00273489 1.2208e-07 0 0.00260037 7.46488e-08 0 0.00251151 5.52849e-08 0 0.00243939 5.01356e-08 0
+          0.00237404 4.53993e-08 0 0.00232313 2.91002e-08 0 0.0555374 0.00021506 0 0.00868083 5.97196e-06 0
+          0.00576402 1.26521e-06 0 0.00500832 5.63424e-07 0 0.00463409 3.42071e-07 0 0.00440634 2.09101e-07 0
+          0.00425585 1.55017e-07 0 0.00413361 1.40579e-07 0 0.00402284 1.27285e-07 0 0.0039368 8.11787e-08 0
+          0.0584742 0.000327355 0 0.0134151 1.40065e-05 0 0.00906137 3.09446e-06 0 0.00787519 1.37889e-06 0
+          0.00728728 8.37068e-07 0 0.0069296 5.11463e-07 0 0.00669313 3.7971e-07 0 0.00650083 3.44356e-07 0
+          0.00632658 3.11748e-07 0 0.00619178 1.97443e-07 0 0.0623036 0.000471854 0 0.0197442 2.9853e-05 0
+          0.0136522 6.98801e-06 0 0.0118729 3.11999e-06 0 0.0109884 1.89416e-06 0 0.0104504 1.1567e-06 0
+          0.0100944 8.60505e-07 0 0.00980436 7.80462e-07 0 0.00954155 7.0644e-07 0 0.00933933 4.43109e-07 0
+          0.0671371 0.000651421 0 0.02802 5.90688e-05 0 0.0199947 1.49437e-05 0 0.0174217 6.70905e-06 0
+          0.0161318 4.07653e-06 0 0.0153463 2.4877e-06 0 0.0148258 1.85646e-06 0 0.0144004 1.68434e-06 0
+          0.0140148 1.52438e-06 0 0.0137203 9.43528e-07 0 0.0729254 0.00086396 0 0.0384191 0.0001091 0
+          0.0285648 3.04492e-05 0 0.0250143 1.38601e-05 0 0.0231951 8.44884e-06 0 0.0220825 5.15255e-06 0
+          0.0213429 3.86476e-06 0 0.0207349 3.51016e-06 0 0.0201829 3.17729e-06 0 0.0197651 1.93215e-06 0
+          0.0792792 0.00109977 0 0.0505424 0.000187535 0 0.0395002 5.8449e-05 0 0.0349817 2.73877e-05 0
+          0.0325572 1.6842e-05 0 0.0310573 1.02668e-05 0 0.0300533 7.77045e-06 0 0.029218 7.07815e-06 0
+          0.0284562 6.4143e-06 0 0.0278847 3.8162e-06 0 0.0853808 0.00134223 0 0.0629816 0.000298838 0
+          0.0519343 0.000103189 0 0.0468866 5.08456e-05 0 0.0439532 3.18306e-05 0 0.0421003 1.93776e-05 0
+          0.0408462 1.49051e-05 0 0.0397778 1.36655e-05 0 0.0387932 1.24249e-05 0 0.0380596 7.21614e-06 0
+          0.0907074 0.00156992 0 0.0744678 0.000443107 0 0.0642526 0.000167823 0 0.0591469 8.67181e-05 0
+          0.0560313 5.60809e-05 0 0.0539843 3.40152e-05 0 0.0525725 2.68918e-05 0 0.051323 2.49e-05 0
+          0.0501563 2.27648e-05 0 0.0492907 1.29091e-05 0 0.095123 0.00175592 0 0.0847407 0.000612183 0
+          0.0757745 0.000261436 0 0.0702195 0.000141739 0 0.0668961 9.06889e-05 0 0.0649728 5.40916e-05 0
+          0.063615 4.50362e-05 0 0.0622949 4.24947e-05 0 0.0610176 3.9264e-05 0 0.0600654 2.17761e-05 0
+          0.098358 0.00187183 0 0.0932517 0.000779448 0 0.0866042 0.000389325 0 0.0810724 0.000228673 0
+          0.0772504 0.000143867 0 0.0748143 8.70684e-05 0 0.0730182 7.46097e-05 0 0.0714403 6.99255e-05 0
+          0.0700432 6.40616e-05 0 0.0690501 3.48138e-05 0 0.100302 0.0018994 0 0.0991322 0.000904384 0
+          0.0956408 0.000525252 0 0.0916447 0.000344352 0 0.0879952 0.000230161 0 0.0849887 0.000151044 0
+          0.0825889 0.000127229 0 0.0806415 0.000114642 0 0.0790376 0.000101722 0 0.0779524 5.39649e-05 0
+          0.101209 0.00183626 0 0.102294 0.000956443 0 0.101453 0.000621009 0 0.099707 0.000452495 0
+          0.0975086 0.000335001 0 0.0951603 0.00024547 0 0.0929343 0.000207437 0 0.0909731 0.000183014 0
+          0.0892903 0.000158717 0 0.0881454 8.20743e-05 0 0.101478 0.00169099 0 0.103454 0.000930986 0
+          0.104087 0.000644443 0 0.104086 0.00050654 0 0.103584 0.000409524 0 0.102672 0.000331666 0
+          0.101522 0.000291269 0 0.10031 0.000261277 0 0.0991384 0.000227755 0 0.0982913 0.000116349 0
+          0.101473 0.00147129 0 0.103628 0.000840885 0 0.104766 0.00059636 0 0.105546 0.000486978 0
+          0.106058 0.000415698 0 0.106298 0.000361286 0 0.106315 0.000331559 0 0.106186 0.000307376 0
+          0.105963 0.00027369 0 0.10576 0.000140664 0 0.101386 0.00117473 0 0.103497 0.000693586 0
+          0.104742 0.000493265 0 0.105695 0.000406431 0 0.106496 0.000354351 0 0.107179 0.000318752 0
+          0.107772 0.000300529 0 0.108298 0.000285589 0 0.108762 0.000258432 0 0.109078 0.000135133 0
+          0.101284 0.000787551 0 0.103311 0.000478927 0 0.104588 0.000339027 0 0.105565 0.000278247 0
+          0.106402 0.000242765 0 0.107151 0.000219757 0 0.107849 0.000208615 0 0.108516 0.000199748 0
+          0.109145 0.000180907 0 0.1096 9.66496e-05 0 0.101193 0.000284475 0 0.103126 0.000176195 0
+          0.104386 0.000124091 0 0.105331 0.000101289 0 0.106125 8.802e-05 0 0.106828 7.94711e-05 0
+          0.107477 7.53139e-05 0 0.108095 7.20105e-05 0 0.108669 6.4817e-05 0 0.109089 3.51948e-05 0
         </DataArray>
         <DataArray type="Float32" Name="process rank" NumberOfComponents="1" format="ascii">
           0 0 0 0 0 0 0 0 0 0 0 0
diff --git a/test/references/test_channel_zeroeq2cni.vtu b/test/references/test_channel_zeroeq2cni.vtu
index da3c86313f538aa8a104638fc9664c668a82f5e1..fd177e1fdb983ee8481cb4d60dfb9997fd8b9a44 100644
--- a/test/references/test_channel_zeroeq2cni.vtu
+++ b/test/references/test_channel_zeroeq2cni.vtu
@@ -23,98 +23,98 @@
           100000 100000 100000 100000 100000 100000 100000 100000
         </DataArray>
         <DataArray type="Float32" Name="rhoMolar" NumberOfComponents="1" format="ascii">
-          38.4401 38.4228 38.4196 38.4184 38.4175 38.4171 38.4167 38.4164 38.4161 38.4159 38.5176 38.4601
-          38.4493 38.4452 38.4422 38.4408 38.4396 38.4384 38.4373 38.4369 38.6232 38.5126 38.491 38.4827
-          38.4768 38.474 38.4716 38.4693 38.4671 38.4662 38.7656 38.5862 38.5495 38.5354 38.5254 38.5205
-          38.5165 38.5126 38.5088 38.5073 38.955 38.6896 38.6317 38.6095 38.5936 38.5859 38.5796 38.5733
-          38.5674 38.5651 39.202 38.835 38.7472 38.7136 38.6895 38.6778 38.6682 38.6587 38.6498 38.6462
-          39.5153 39.0381 38.9095 38.8598 38.8243 38.8069 38.7928 38.7787 38.7654 38.7601 39.8975 39.3169
-          39.1359 39.0645 39.0129 38.9878 38.9673 38.9468 38.9275 38.9199 40.3378 39.6801 39.4428 39.345
-          39.2723 39.2373 39.2082 39.179 39.1516 39.1408 40.8041 40.1058 39.8297 39.707 39.6099 39.5643
-          39.5252 39.4853 39.4477 39.4336 41.2568 40.5631 40.258 40.1254 40.0054 39.9525 39.9031 39.8521
-          39.8037 39.7873 41.6692 41.0557 40.7058 40.5414 40.4049 40.3561 40.2991 40.2386 40.1801 40.1645
-          42.0101 41.5518 41.2006 40.97 40.8088 40.7369 40.6644 40.5937 40.5271 40.5204 42.2514 41.9734
-          41.7005 41.4625 41.278 41.1454 41.0405 40.9513 40.8745 40.8533 42.3916 42.2672 42.1077 41.9321
-          41.7719 41.6248 41.5002 41.393 41.3026 41.236 42.4537 42.4166 42.3587 42.2716 42.1769 42.07
-          41.9651 41.8656 41.7765 41.6933 42.478 42.4742 42.4643 42.4426 42.4129 42.364 42.3072 42.2459
-          42.1846 42.1176 42.4684 42.4619 42.4559 42.4488 42.4412 42.4278 42.4123 42.3947 42.3755 42.3456
-          42.4784 42.4795 42.4802 42.4806 42.4805 42.4801 42.4789 42.4771 42.4747 42.4705 42.4767 42.4769
+          38.4418 38.4229 38.4196 38.4184 38.4175 38.4171 38.4168 38.4164 38.4161 38.416 38.5231 38.4605
+          38.4494 38.4453 38.4423 38.4409 38.4397 38.4385 38.4374 38.437 38.6335 38.5134 38.4912 38.4829
+          38.477 38.4742 38.4718 38.4695 38.4673 38.4664 38.782 38.5876 38.5499 38.5358 38.5257 38.5209
+          38.5169 38.5129 38.5091 38.5076 38.9786 38.6919 38.6323 38.61 38.5941 38.5865 38.5802 38.5739
+          38.5679 38.5656 39.2332 38.8383 38.7482 38.7143 38.6902 38.6787 38.6692 38.6595 38.6505 38.6469
+          39.5535 39.0431 38.9111 38.861 38.8253 38.8083 38.7942 38.7798 38.7665 38.7613 39.9402 39.324
+          39.1382 39.0662 39.0145 38.9898 38.9693 38.9485 38.9291 38.9215 40.3805 39.69 39.4463 39.3475
+          39.2746 39.2401 39.2111 39.1815 39.1538 39.1432 40.8413 40.1186 39.8352 39.7108 39.6133 39.5684
+          39.5292 39.4887 39.4508 39.4368 41.2826 40.5761 40.2658 40.1311 40.0101 39.9581 39.9084 39.8565
+          39.8076 39.7914 41.6804 41.0647 40.7136 40.5487 40.4111 40.3632 40.3056 40.2438 40.1847 40.1693
+          42.0088 41.5549 41.2051 40.9763 40.8148 40.744 40.6709 40.5992 40.532 40.5258 42.2439 41.971
+          41.7012 41.4651 41.2816 41.1499 41.0451 40.9562 40.879 40.8583 42.3845 42.2623 42.1054 41.9315
+          41.7729 41.6265 41.5025 41.3958 41.3057 41.2393 42.45 42.4128 42.3558 42.2695 42.1759 42.0697
+          41.9653 41.8664 41.7778 41.6948 42.4765 42.4723 42.4624 42.4409 42.4116 42.3629 42.3065 42.2455
+          42.1847 42.1177 42.4686 42.4621 42.4561 42.449 42.4414 42.428 42.4126 42.395 42.376 42.3461
+          42.4782 42.4793 42.48 42.4803 42.4802 42.4798 42.4786 42.4767 42.4744 42.4701 42.4767 42.4769
           42.4771 42.4774 42.4777 42.478 42.4783 42.4785 42.4788 42.4791
         </DataArray>
         <DataArray type="Float32" Name="rho" NumberOfComponents="1" format="ascii">
-          1.11323 1.11272 1.11263 1.1126 1.11257 1.11256 1.11255 1.11253 1.11252 1.11251 1.11547 1.11381
-          1.11349 1.11337 1.11329 1.11324 1.11321 1.11317 1.11314 1.11312 1.11853 1.11532 1.1147 1.11446
-          1.11429 1.1142 1.11413 1.11406 1.114 1.11397 1.12265 1.11746 1.11639 1.11599 1.1157 1.11555
-          1.11544 1.11532 1.11521 1.11516 1.12814 1.12045 1.11877 1.11813 1.11767 1.11745 1.11726 1.11708
-          1.1169 1.11683 1.13529 1.12466 1.12212 1.12114 1.12045 1.12011 1.11983 1.11955 1.11929 1.11918
-          1.14436 1.13054 1.12682 1.12538 1.12435 1.12385 1.12344 1.12302 1.12264 1.12248 1.15543 1.13862
-          1.13338 1.13131 1.12981 1.12909 1.12849 1.12789 1.12733 1.12711 1.16818 1.14914 1.14226 1.13943
-          1.13733 1.13631 1.13547 1.13462 1.13382 1.13351 1.18169 1.16146 1.15347 1.14991 1.1471 1.14578
-          1.14465 1.14349 1.1424 1.14198 1.1948 1.17471 1.16587 1.16203 1.15856 1.15702 1.15559 1.15411
-          1.15271 1.15223 1.20674 1.18897 1.17884 1.17408 1.17013 1.16871 1.16706 1.1653 1.16361 1.16315
-          1.21661 1.20334 1.19317 1.18649 1.18182 1.17974 1.17764 1.17559 1.17365 1.17345 1.2236 1.21555
-          1.20765 1.20075 1.19541 1.19157 1.18853 1.18594 1.18371 1.18309 1.22766 1.22406 1.21944 1.21435
-          1.20971 1.20545 1.20183 1.19873 1.19611 1.19417 1.22946 1.22838 1.2267 1.22418 1.22143 1.21833
-          1.21529 1.2124 1.20981 1.2074 1.23015 1.23003 1.22973 1.2291 1.22823 1.22681 1.22515 1.22337
-          1.22159 1.21964 1.22948 1.22933 1.22919 1.22901 1.22881 1.22845 1.22802 1.22753 1.22699 1.22614
-          1.23015 1.23016 1.23017 1.23017 1.23017 1.23015 1.23011 1.23005 1.22998 1.22985 1.23012 1.23013
+          1.11328 1.11273 1.11263 1.1126 1.11257 1.11256 1.11255 1.11253 1.11252 1.11251 1.11563 1.11382
+          1.1135 1.11337 1.11329 1.11325 1.11321 1.11317 1.11314 1.11312 1.11883 1.11535 1.11471 1.11446
+          1.11429 1.11421 1.11414 1.11407 1.114 1.11397 1.12313 1.1175 1.11641 1.116 1.1157 1.11556
+          1.11545 1.11533 1.11522 1.11517 1.12882 1.12052 1.11879 1.11814 1.11768 1.11746 1.11728 1.11709
+          1.11692 1.11685 1.13619 1.12476 1.12215 1.12117 1.12047 1.12013 1.11986 1.11957 1.11931 1.1192
+          1.14547 1.13069 1.12686 1.12541 1.12438 1.12389 1.12348 1.12306 1.12267 1.12251 1.15667 1.13882
+          1.13344 1.13136 1.12986 1.12914 1.12855 1.12794 1.12738 1.12715 1.16942 1.14942 1.14237 1.1395
+          1.13739 1.13639 1.13555 1.13469 1.13389 1.13357 1.18276 1.16183 1.15363 1.15003 1.1472 1.1459
+          1.14476 1.14359 1.14249 1.14208 1.19554 1.17509 1.1661 1.1622 1.15869 1.15718 1.15574 1.15424
+          1.15282 1.15235 1.20706 1.18923 1.17906 1.17429 1.1703 1.16892 1.16725 1.16545 1.16374 1.16329
+          1.21658 1.20343 1.1933 1.18667 1.18199 1.17994 1.17783 1.17575 1.17379 1.17361 1.22338 1.21548
+          1.20767 1.20083 1.19551 1.1917 1.18866 1.18608 1.18384 1.18324 1.22745 1.22392 1.21937 1.21434
+          1.20974 1.2055 1.2019 1.19881 1.1962 1.19426 1.22935 1.22827 1.22662 1.22412 1.22141 1.21832
+          1.21529 1.21242 1.20985 1.20744 1.23011 1.22998 1.22968 1.22905 1.22819 1.22677 1.22513 1.22336
+          1.2216 1.21965 1.22949 1.22935 1.2292 1.22902 1.22882 1.22846 1.22803 1.22754 1.22701 1.22616
+          1.23014 1.23015 1.23016 1.23016 1.23016 1.23014 1.2301 1.23004 1.22997 1.22984 1.23012 1.23013
           1.23013 1.23014 1.23015 1.23016 1.23016 1.23017 1.23018 1.23018
         </DataArray>
         <DataArray type="Float32" Name="X^H2O_gas" NumberOfComponents="1" format="ascii">
-          3.21817e-10 9.09135e-09 7.10592e-08 3.53583e-07 9.69345e-07 2.44456e-06 4.89663e-06 8.2655e-06 1.23976e-05 1.81476e-05 3.21951e-10 9.09137e-09
-          7.10593e-08 3.53584e-07 9.69345e-07 2.44456e-06 4.89664e-06 8.2655e-06 1.23976e-05 1.81476e-05 3.22403e-10 9.09162e-09 7.10602e-08 3.53587e-07
-          9.69353e-07 2.44458e-06 4.89666e-06 8.26554e-06 1.23976e-05 1.81477e-05 3.2356e-10 9.0928e-09 7.10648e-08 3.53606e-07 9.69389e-07 2.44466e-06
-          4.8968e-06 8.26572e-06 1.23979e-05 1.8148e-05 3.26224e-10 9.09729e-09 7.10826e-08 3.53675e-07 9.69527e-07 2.44498e-06 4.8973e-06 8.2664e-06
-          1.23987e-05 1.81491e-05 3.32058e-10 9.11221e-09 7.11428e-08 3.53908e-07 9.69988e-07 2.44603e-06 4.89899e-06 8.26865e-06 1.24013e-05 1.81528e-05
-          3.44539e-10 9.15806e-09 7.13324e-08 3.54637e-07 9.71434e-07 2.44931e-06 4.90426e-06 8.27569e-06 1.24097e-05 1.81644e-05 3.71057e-10 9.28987e-09
-          7.18996e-08 3.56816e-07 9.75759e-07 2.45911e-06 4.91999e-06 8.29669e-06 1.24348e-05 1.81988e-05 4.27614e-10 9.63984e-09 7.34998e-08 3.63e-07
-          9.88078e-07 2.48706e-06 4.96486e-06 8.35664e-06 1.25063e-05 1.82968e-05 5.49632e-10 1.04698e-08 7.76105e-08 3.79162e-07 1.02048e-06 2.561e-06
-          5.08376e-06 8.51577e-06 1.26964e-05 1.85579e-05 8.30515e-10 1.23649e-08 8.67951e-08 4.16374e-07 1.09567e-06 2.73396e-06 5.36195e-06 8.88895e-06
-          1.31434e-05 1.91742e-05 1.59595e-09 1.72279e-08 1.07185e-07 4.89613e-07 1.24482e-06 3.08278e-06 5.92241e-06 9.64101e-06 1.40433e-05 2.04229e-05
-          4.21197e-09 3.15882e-08 1.61079e-07 6.52186e-07 1.55585e-06 3.7207e-06 6.90538e-06 1.09385e-05 1.55892e-05 2.26056e-05 1.6216e-08 8.35829e-08
-          3.29209e-07 1.11366e-06 2.36243e-06 5.14681e-06 8.95792e-06 1.35288e-05 1.85985e-05 2.63733e-05 9.92443e-08 3.61973e-07 9.95497e-07 2.64339e-06
-          4.77193e-06 9.17119e-06 1.44214e-05 2.00934e-05 2.59343e-05 3.45694e-05 1.02064e-06 2.68792e-06 5.0737e-06 9.30353e-06 1.36659e-05 2.21947e-05
-          3.03531e-05 3.78793e-05 4.47733e-05 5.50919e-05 1.7829e-05 3.14745e-05 4.27951e-05 5.37485e-05 6.25315e-05 7.58027e-05 8.56181e-05 9.2815e-05
-          9.82502e-05 0.000108529 0.000539765 0.000486118 0.000446697 0.000412285 0.000383392 0.000349978 0.000321365 0.000296955 0.00027649 0.000249421
-          3.6357e-05 5.8499e-05 7.33527e-05 8.47391e-05 9.37337e-05 0.00010196 0.000108641 0.000114006 0.000118136 0.000122713 1.09718e-06 2.41508e-06
-          3.71423e-06 5.02756e-06 6.34958e-06 7.74902e-06 9.18557e-06 1.06311e-05 1.20178e-05 1.36167e-05
+          2.39139e-10 8.58932e-09 6.93538e-08 3.49898e-07 9.59273e-07 2.42939e-06 4.86689e-06 8.2044e-06 1.22928e-05 1.79969e-05 2.39249e-10 8.58934e-09
+          6.93539e-08 3.49898e-07 9.59274e-07 2.42939e-06 4.86689e-06 8.20441e-06 1.22928e-05 1.79969e-05 2.39619e-10 8.58957e-09 6.93548e-08 3.49902e-07
+          9.59281e-07 2.42941e-06 4.86692e-06 8.20445e-06 1.22929e-05 1.7997e-05 2.40565e-10 8.59068e-09 6.93593e-08 3.4992e-07 9.59317e-07 2.42949e-06
+          4.86705e-06 8.20463e-06 1.22931e-05 1.79973e-05 2.42739e-10 8.59487e-09 6.93764e-08 3.49988e-07 9.59452e-07 2.4298e-06 4.86755e-06 8.2053e-06
+          1.22939e-05 1.79984e-05 2.4749e-10 8.60883e-09 6.94344e-08 3.50217e-07 9.59906e-07 2.43085e-06 4.86923e-06 8.20753e-06 1.22966e-05 1.80021e-05
+          2.57636e-10 8.65173e-09 6.96174e-08 3.50935e-07 9.61329e-07 2.43411e-06 4.87446e-06 8.21451e-06 1.23049e-05 1.80136e-05 2.79165e-10 8.77518e-09
+          7.0165e-08 3.53078e-07 9.65586e-07 2.44385e-06 4.89009e-06 8.23534e-06 1.23297e-05 1.80477e-05 3.25107e-10 9.10344e-09 7.17116e-08 3.59166e-07
+          9.77714e-07 2.47164e-06 4.93468e-06 8.29477e-06 1.24005e-05 1.81452e-05 4.24625e-10 9.88368e-09 7.56934e-08 3.75092e-07 1.00964e-06 2.54516e-06
+          5.05283e-06 8.45252e-06 1.25889e-05 1.84046e-05 6.54821e-10 1.16595e-08 8.46124e-08 4.11809e-07 1.08374e-06 2.71718e-06 5.32921e-06 8.82234e-06
+          1.30315e-05 1.90168e-05 1.28914e-09 1.62038e-08 1.04334e-07 4.84157e-07 1.2308e-06 3.06425e-06 5.88596e-06 9.5673e-06 1.3922e-05 2.02564e-05
+          3.50233e-09 2.96429e-08 1.56242e-07 6.43739e-07 1.53645e-06 3.696e-06 6.85925e-06 1.08522e-05 1.54509e-05 2.24226e-05 1.39425e-08 7.84502e-08
+          3.18157e-07 1.09442e-06 2.32643e-06 5.10021e-06 8.88297e-06 1.34099e-05 1.84216e-05 2.61501e-05 8.85756e-08 3.41626e-07 9.60181e-07 2.58676e-06
+          4.68428e-06 9.05956e-06 1.42652e-05 1.98783e-05 2.56526e-05 3.42333e-05 9.46172e-07 2.56645e-06 4.90566e-06 9.08154e-06 1.33846e-05 2.18589e-05
+          2.99445e-05 3.73932e-05 4.42142e-05 5.44699e-05 1.70895e-05 3.04991e-05 4.1696e-05 5.2572e-05 6.13014e-05 7.45443e-05 8.43214e-05 9.14896e-05
+          9.69106e-05 0.000107166 0.000530696 0.000477949 0.000439624 0.000406087 0.00037791 0.000345102 0.000317022 0.000293077 0.000273014 0.000246345
+          4.06447e-05 6.22576e-05 7.64818e-05 8.73786e-05 9.59876e-05 0.000103886 0.000110295 0.000115431 0.000119369 0.000123739 1.39182e-06 2.80084e-06
+          4.13526e-06 5.46849e-06 6.80257e-06 8.2111e-06 9.65428e-06 1.11035e-05 1.24904e-05 1.40933e-05
         </DataArray>
         <DataArray type="Float32" Name="x^H2O_gas" NumberOfComponents="1" format="ascii">
-          5.17331e-10 1.46146e-08 1.1423e-07 5.68397e-07 1.55825e-06 3.9297e-06 7.87147e-06 1.3287e-05 1.99294e-05 2.91725e-05 5.17547e-10 1.46147e-08
-          1.1423e-07 5.68397e-07 1.55825e-06 3.92971e-06 7.87148e-06 1.3287e-05 1.99294e-05 2.91726e-05 5.18274e-10 1.46151e-08 1.14232e-07 5.68404e-07
-          1.55827e-06 3.92974e-06 7.87153e-06 1.32871e-05 1.99295e-05 2.91727e-05 5.20134e-10 1.4617e-08 1.14239e-07 5.68433e-07 1.55832e-06 3.92987e-06
-          7.87174e-06 1.32874e-05 1.99298e-05 2.91732e-05 5.24416e-10 1.46242e-08 1.14268e-07 5.68545e-07 1.55855e-06 3.93037e-06 7.87256e-06 1.32884e-05
-          1.99311e-05 2.9175e-05 5.33794e-10 1.46482e-08 1.14364e-07 5.68919e-07 1.55929e-06 3.93206e-06 7.87527e-06 1.32921e-05 1.99354e-05 2.91809e-05
-          5.53857e-10 1.47219e-08 1.14669e-07 5.70091e-07 1.56161e-06 3.93734e-06 7.88373e-06 1.33034e-05 1.99489e-05 2.91995e-05 5.96486e-10 1.49338e-08
-          1.15581e-07 5.73593e-07 1.56856e-06 3.95309e-06 7.90902e-06 1.33371e-05 1.99891e-05 2.92548e-05 6.87403e-10 1.54964e-08 1.18153e-07 5.83535e-07
-          1.58837e-06 3.99802e-06 7.98115e-06 1.34335e-05 2.01041e-05 2.94124e-05 8.83552e-10 1.68306e-08 1.24762e-07 6.09516e-07 1.64046e-06 4.11688e-06
-          8.17228e-06 1.36893e-05 2.04098e-05 2.98321e-05 1.33508e-09 1.98769e-08 1.39526e-07 6.69334e-07 1.76133e-06 4.39493e-06 8.61949e-06 1.42892e-05
-          2.11283e-05 3.08228e-05 2.56554e-09 2.76945e-08 1.72304e-07 7.87069e-07 2.00109e-06 4.95566e-06 9.52043e-06 1.54981e-05 2.25749e-05 3.28301e-05
-          6.77088e-09 5.0779e-08 2.58941e-07 1.04841e-06 2.50108e-06 5.98114e-06 1.11006e-05 1.7584e-05 2.506e-05 3.63388e-05 2.60677e-08 1.34362e-07
-          5.29215e-07 1.79024e-06 3.79767e-06 8.27365e-06 1.44001e-05 2.17478e-05 2.98973e-05 4.23952e-05 1.59538e-07 5.81883e-07 1.60029e-06 4.24934e-06
-          7.67102e-06 1.47429e-05 2.31827e-05 3.23004e-05 4.16896e-05 5.55703e-05 1.64072e-06 4.32091e-06 8.15612e-06 1.49556e-05 2.19681e-05 3.56782e-05
-          4.87927e-05 6.08908e-05 7.19727e-05 8.85591e-05 2.86604e-05 5.05954e-05 6.87927e-05 8.63997e-05 0.000100518 0.00012185 0.000137627 0.000149195
-          0.000157931 0.000174453 0.000867405 0.00078122 0.000717885 0.000662596 0.000616171 0.000562482 0.000516503 0.000477279 0.000444392 0.000400892
-          5.84438e-05 9.40358e-05 0.000117912 0.000136214 0.000150671 0.000163894 0.000174633 0.000183256 0.000189894 0.00019725 1.76375e-06 3.88231e-06
-          5.97074e-06 8.08195e-06 1.02071e-05 1.24567e-05 1.4766e-05 1.70897e-05 1.93188e-05 2.18891e-05
+          3.84423e-10 1.38076e-08 1.11489e-07 5.62472e-07 1.54206e-06 3.90532e-06 7.82366e-06 1.31888e-05 1.9761e-05 2.89303e-05 3.846e-10 1.38077e-08
+          1.11489e-07 5.62473e-07 1.54206e-06 3.90532e-06 7.82366e-06 1.31888e-05 1.9761e-05 2.89303e-05 3.85195e-10 1.3808e-08 1.1149e-07 5.62479e-07
+          1.54208e-06 3.90535e-06 7.82371e-06 1.31889e-05 1.97611e-05 2.89304e-05 3.86716e-10 1.38098e-08 1.11497e-07 5.62508e-07 1.54213e-06 3.90548e-06
+          7.82392e-06 1.31891e-05 1.97614e-05 2.89309e-05 3.90211e-10 1.38165e-08 1.11525e-07 5.62618e-07 1.54235e-06 3.90598e-06 7.82473e-06 1.31902e-05
+          1.97627e-05 2.89327e-05 3.97849e-10 1.3839e-08 1.11618e-07 5.62986e-07 1.54308e-06 3.90766e-06 7.82742e-06 1.31938e-05 1.9767e-05 2.89386e-05
+          4.14159e-10 1.39079e-08 1.11912e-07 5.64139e-07 1.54537e-06 3.9129e-06 7.83584e-06 1.3205e-05 1.97803e-05 2.89571e-05 4.48767e-10 1.41064e-08
+          1.12793e-07 5.67584e-07 1.55221e-06 3.92856e-06 7.86096e-06 1.32385e-05 1.98202e-05 2.9012e-05 5.22621e-10 1.46341e-08 1.15279e-07 5.77371e-07
+          1.57171e-06 3.97323e-06 7.93264e-06 1.33341e-05 1.99341e-05 2.91687e-05 6.82599e-10 1.58883e-08 1.2168e-07 6.02973e-07 1.62302e-06 4.09143e-06
+          8.12256e-06 1.35876e-05 2.02369e-05 2.95857e-05 1.05265e-09 1.87431e-08 1.36017e-07 6.61996e-07 1.74214e-06 4.36796e-06 8.56686e-06 1.41821e-05
+          2.09484e-05 3.05698e-05 2.07234e-09 2.60482e-08 1.6772e-07 7.78298e-07 1.97855e-06 4.92588e-06 9.46185e-06 1.53797e-05 2.23799e-05 3.25625e-05
+          5.63011e-09 4.76519e-08 2.51164e-07 1.03483e-06 2.46989e-06 5.94142e-06 1.10264e-05 1.74451e-05 2.48376e-05 3.60446e-05 2.2413e-08 1.26111e-07
+          5.11448e-07 1.75931e-06 3.73981e-06 8.19874e-06 1.42796e-05 2.15567e-05 2.9613e-05 4.20364e-05 1.42388e-07 5.49174e-07 1.54352e-06 4.1583e-06
+          7.53011e-06 1.45635e-05 2.29317e-05 3.19547e-05 4.12368e-05 5.503e-05 1.521e-06 4.12565e-06 7.88599e-06 1.45988e-05 2.15161e-05 3.51384e-05
+          4.81359e-05 6.01095e-05 7.10739e-05 8.75593e-05 2.74717e-05 4.90273e-05 6.7026e-05 8.45085e-05 9.85403e-05 0.000119827 0.000135543 0.000147064
+          0.000155778 0.000172261 0.000852836 0.000768096 0.000706521 0.000652637 0.000607363 0.000554647 0.000509525 0.000471047 0.000438807 0.000395949
+          6.5336e-05 0.000100077 0.000122941 0.000140457 0.000154294 0.000166989 0.000177292 0.000185546 0.000191876 0.0001989 2.23739e-06 4.50243e-06
+          6.64755e-06 8.79074e-06 1.09353e-05 1.31996e-05 1.55195e-05 1.78491e-05 2.00786e-05 2.26552e-05
         </DataArray>
         <DataArray type="Float32" Name="D^H2O_gas" NumberOfComponents="1" format="ascii">
-          2.71983e-05 2.72205e-05 2.72245e-05 2.72261e-05 2.72272e-05 2.72277e-05 2.72282e-05 2.72286e-05 2.7229e-05 2.72292e-05 2.70999e-05 2.71729e-05
-          2.71867e-05 2.71919e-05 2.71957e-05 2.71975e-05 2.7199e-05 2.72005e-05 2.72019e-05 2.72025e-05 2.69667e-05 2.71063e-05 2.71337e-05 2.71442e-05
-          2.71516e-05 2.71553e-05 2.71583e-05 2.71613e-05 2.71641e-05 2.71652e-05 2.67886e-05 2.70133e-05 2.70596e-05 2.70774e-05 2.709e-05 2.70962e-05
-          2.71013e-05 2.71063e-05 2.71111e-05 2.7113e-05 2.65546e-05 2.68834e-05 2.69561e-05 2.6984e-05 2.70039e-05 2.70137e-05 2.70216e-05 2.70295e-05
-          2.70369e-05 2.70399e-05 2.62543e-05 2.67026e-05 2.68116e-05 2.68535e-05 2.68836e-05 2.68983e-05 2.69102e-05 2.69222e-05 2.69334e-05 2.69379e-05
-          2.58808e-05 2.6453e-05 2.66106e-05 2.66718e-05 2.67159e-05 2.67374e-05 2.67549e-05 2.67724e-05 2.67889e-05 2.67955e-05 2.54363e-05 2.61164e-05
-          2.63342e-05 2.64208e-05 2.64837e-05 2.65144e-05 2.65396e-05 2.65648e-05 2.65884e-05 2.65978e-05 2.49387e-05 2.56876e-05 2.59665e-05 2.60828e-05
-          2.61697e-05 2.62118e-05 2.62468e-05 2.6282e-05 2.63152e-05 2.63282e-05 2.4428e-05 2.5199e-05 2.55142e-05 2.56563e-05 2.57696e-05 2.58231e-05
-          2.58691e-05 2.59162e-05 2.59607e-05 2.59774e-05 2.39477e-05 2.46898e-05 2.50277e-05 2.51767e-05 2.53129e-05 2.53732e-05 2.54298e-05 2.54884e-05
-          2.55442e-05 2.55632e-05 2.35228e-05 2.41592e-05 2.45343e-05 2.47137e-05 2.48641e-05 2.49183e-05 2.49818e-05 2.50494e-05 2.51151e-05 2.51327e-05
-          2.31803e-05 2.36425e-05 2.40065e-05 2.42502e-05 2.4423e-05 2.45006e-05 2.45793e-05 2.46564e-05 2.47294e-05 2.47367e-05 2.29425e-05 2.32168e-05
-          2.3491e-05 2.37342e-05 2.39255e-05 2.40645e-05 2.41753e-05 2.42701e-05 2.43523e-05 2.43751e-05 2.28061e-05 2.2927e-05 2.30837e-05 2.32579e-05
-          2.34188e-05 2.35679e-05 2.36955e-05 2.3806e-05 2.38998e-05 2.39695e-05 2.27461e-05 2.2782e-05 2.2838e-05 2.29228e-05 2.30155e-05 2.31208e-05
-          2.32251e-05 2.33244e-05 2.34141e-05 2.34983e-05 2.27227e-05 2.27264e-05 2.27359e-05 2.27568e-05 2.27855e-05 2.28328e-05 2.2888e-05 2.29479e-05
-          2.30079e-05 2.30739e-05 2.27319e-05 2.27382e-05 2.2744e-05 2.27508e-05 2.27582e-05 2.27711e-05 2.27861e-05 2.28032e-05 2.28217e-05 2.28507e-05
-          2.27223e-05 2.27212e-05 2.27205e-05 2.27202e-05 2.27203e-05 2.27207e-05 2.27218e-05 2.27236e-05 2.27259e-05 2.273e-05 2.2724e-05 2.27238e-05
+          2.71962e-05 2.72203e-05 2.72245e-05 2.7226e-05 2.72271e-05 2.72277e-05 2.72281e-05 2.72286e-05 2.7229e-05 2.72291e-05 2.7093e-05 2.71723e-05
+          2.71865e-05 2.71918e-05 2.71956e-05 2.71974e-05 2.71989e-05 2.72004e-05 2.72018e-05 2.72024e-05 2.69537e-05 2.71053e-05 2.71334e-05 2.71439e-05
+          2.71514e-05 2.7155e-05 2.7158e-05 2.7161e-05 2.71638e-05 2.71649e-05 2.67682e-05 2.70115e-05 2.70591e-05 2.7077e-05 2.70897e-05 2.70958e-05
+          2.71008e-05 2.71059e-05 2.71107e-05 2.71126e-05 2.65258e-05 2.68806e-05 2.69552e-05 2.69833e-05 2.70033e-05 2.70129e-05 2.70208e-05 2.70289e-05
+          2.70363e-05 2.70393e-05 2.62168e-05 2.66984e-05 2.68103e-05 2.68526e-05 2.68827e-05 2.68971e-05 2.6909e-05 2.69212e-05 2.69325e-05 2.69369e-05
+          2.58359e-05 2.6447e-05 2.66087e-05 2.66705e-05 2.67145e-05 2.67357e-05 2.67532e-05 2.6771e-05 2.67876e-05 2.67941e-05 2.53873e-05 2.61079e-05
+          2.63314e-05 2.64188e-05 2.64818e-05 2.6512e-05 2.65371e-05 2.65627e-05 2.65865e-05 2.65958e-05 2.48912e-05 2.56761e-05 2.59623e-05 2.60798e-05
+          2.6167e-05 2.62084e-05 2.62433e-05 2.62791e-05 2.63125e-05 2.63254e-05 2.4388e-05 2.51845e-05 2.55079e-05 2.56518e-05 2.57656e-05 2.58183e-05
+          2.58644e-05 2.59122e-05 2.5957e-05 2.59736e-05 2.39207e-05 2.46756e-05 2.5019e-05 2.51704e-05 2.53075e-05 2.53669e-05 2.54237e-05 2.54834e-05
+          2.55397e-05 2.55585e-05 2.35113e-05 2.41497e-05 2.45259e-05 2.47056e-05 2.48573e-05 2.49104e-05 2.49745e-05 2.50436e-05 2.511e-05 2.51273e-05
+          2.31815e-05 2.36393e-05 2.40018e-05 2.42435e-05 2.44165e-05 2.44929e-05 2.45722e-05 2.46503e-05 2.4724e-05 2.47308e-05 2.29498e-05 2.32192e-05
+          2.34902e-05 2.37316e-05 2.39217e-05 2.40598e-05 2.41704e-05 2.4265e-05 2.43475e-05 2.43697e-05 2.2813e-05 2.29319e-05 2.30859e-05 2.32585e-05
+          2.34178e-05 2.35662e-05 2.36931e-05 2.38031e-05 2.38966e-05 2.3966e-05 2.27497e-05 2.27856e-05 2.28408e-05 2.29248e-05 2.30165e-05 2.31212e-05
+          2.32248e-05 2.33236e-05 2.34128e-05 2.34968e-05 2.27241e-05 2.27282e-05 2.27377e-05 2.27585e-05 2.27867e-05 2.28339e-05 2.28888e-05 2.29483e-05
+          2.30079e-05 2.30737e-05 2.27317e-05 2.2738e-05 2.27438e-05 2.27506e-05 2.2758e-05 2.27709e-05 2.27858e-05 2.28028e-05 2.28212e-05 2.28502e-05
+          2.27225e-05 2.27214e-05 2.27208e-05 2.27205e-05 2.27206e-05 2.2721e-05 2.27221e-05 2.27239e-05 2.27262e-05 2.27303e-05 2.2724e-05 2.27238e-05
           2.27235e-05 2.27233e-05 2.2723e-05 2.27227e-05 2.27224e-05 2.27222e-05 2.27219e-05 2.27216e-05
         </DataArray>
         <DataArray type="Float32" Name="X^Air_gas" NumberOfComponents="1" format="ascii">
@@ -125,16 +125,16 @@
           0.999988 0.999982 1 1 1 1 0.999999 0.999998 0.999995 0.999992 0.999988 0.999982
           1 1 1 1 0.999999 0.999998 0.999995 0.999992 0.999988 0.999982 1 1
           1 1 0.999999 0.999998 0.999995 0.999992 0.999988 0.999982 1 1 1 1
-          0.999999 0.999997 0.999995 0.999992 0.999987 0.999982 1 1 1 1 0.999999 0.999997
-          0.999995 0.999991 0.999987 0.999981 1 1 1 1 0.999999 0.999997 0.999995 0.999991
+          0.999999 0.999998 0.999995 0.999992 0.999988 0.999982 1 1 1 1 0.999999 0.999997
+          0.999995 0.999992 0.999987 0.999982 1 1 1 1 0.999999 0.999997 0.999995 0.999991
           0.999987 0.999981 1 1 1 1 0.999999 0.999997 0.999994 0.99999 0.999986 0.99998
-          1 1 1 0.999999 0.999998 0.999996 0.999993 0.999989 0.999984 0.999977 1 1
-          1 0.999999 0.999998 0.999995 0.999991 0.999986 0.999981 0.999974 1 1 0.999999 0.999997
-          0.999995 0.999991 0.999986 0.99998 0.999974 0.999965 0.999999 0.999997 0.999995 0.999991 0.999986 0.999978
-          0.99997 0.999962 0.999955 0.999945 0.999982 0.999969 0.999957 0.999946 0.999937 0.999924 0.999914 0.999907
-          0.999902 0.999891 0.99946 0.999514 0.999553 0.999588 0.999617 0.99965 0.999679 0.999703 0.999723 0.999751
-          0.999964 0.999942 0.999927 0.999915 0.999906 0.999898 0.999891 0.999886 0.999882 0.999877 0.999999 0.999998
-          0.999996 0.999995 0.999994 0.999992 0.999991 0.999989 0.999988 0.999986
+          1 1 1 0.999999 0.999998 0.999996 0.999993 0.999989 0.999985 0.999978 1 1
+          1 0.999999 0.999998 0.999995 0.999991 0.999987 0.999982 0.999974 1 1 0.999999 0.999997
+          0.999995 0.999991 0.999986 0.99998 0.999974 0.999966 0.999999 0.999997 0.999995 0.999991 0.999987 0.999978
+          0.99997 0.999963 0.999956 0.999946 0.999983 0.999969 0.999958 0.999947 0.999939 0.999925 0.999916 0.999909
+          0.999903 0.999893 0.999469 0.999522 0.99956 0.999594 0.999622 0.999655 0.999683 0.999707 0.999727 0.999754
+          0.999959 0.999938 0.999924 0.999913 0.999904 0.999896 0.99989 0.999885 0.999881 0.999876 0.999999 0.999997
+          0.999996 0.999995 0.999993 0.999992 0.99999 0.999989 0.999987 0.999986
         </DataArray>
         <DataArray type="Float32" Name="x^Air_gas" NumberOfComponents="1" format="ascii">
           1 1 1 0.999999 0.999998 0.999996 0.999992 0.999987 0.99998 0.999971 1 1
@@ -146,90 +146,90 @@
           1 0.999999 0.999998 0.999996 0.999992 0.999987 0.99998 0.999971 1 1 1 0.999999
           0.999998 0.999996 0.999992 0.999987 0.99998 0.999971 1 1 1 0.999999 0.999998 0.999996
           0.999992 0.999986 0.99998 0.99997 1 1 1 0.999999 0.999998 0.999996 0.999991 0.999986
-          0.999979 0.999969 1 1 1 0.999999 0.999998 0.999995 0.99999 0.999985 0.999977 0.999967
-          1 1 1 0.999999 0.999997 0.999994 0.999989 0.999982 0.999975 0.999964 1 1
+          0.999979 0.999969 1 1 1 0.999999 0.999998 0.999995 0.999991 0.999985 0.999978 0.999967
+          1 1 1 0.999999 0.999998 0.999994 0.999989 0.999983 0.999975 0.999964 1 1
           0.999999 0.999998 0.999996 0.999992 0.999986 0.999978 0.99997 0.999958 1 0.999999 0.999998 0.999996
-          0.999992 0.999985 0.999977 0.999968 0.999958 0.999944 0.999998 0.999996 0.999992 0.999985 0.999978 0.999964
-          0.999951 0.999939 0.999928 0.999911 0.999971 0.999949 0.999931 0.999914 0.9999 0.999878 0.999862 0.999851
-          0.999842 0.999826 0.999133 0.999219 0.999282 0.999337 0.999384 0.999438 0.999484 0.999523 0.999556 0.999599
-          0.999942 0.999906 0.999882 0.999864 0.999849 0.999836 0.999825 0.999817 0.99981 0.999803 0.999998 0.999996
-          0.999994 0.999992 0.99999 0.999988 0.999985 0.999983 0.999981 0.999978
+          0.999992 0.999985 0.999977 0.999968 0.999959 0.999945 0.999998 0.999996 0.999992 0.999985 0.999978 0.999965
+          0.999952 0.99994 0.999929 0.999912 0.999973 0.999951 0.999933 0.999915 0.999901 0.99988 0.999864 0.999853
+          0.999844 0.999828 0.999147 0.999232 0.999294 0.999347 0.999393 0.999445 0.99949 0.999529 0.999561 0.999604
+          0.999935 0.9999 0.999877 0.99986 0.999846 0.999833 0.999823 0.999814 0.999808 0.999801 0.999998 0.999995
+          0.999993 0.999991 0.999989 0.999987 0.999985 0.999982 0.99998 0.999977
         </DataArray>
         <DataArray type="Float32" Name="v_x/v_x,max" NumberOfComponents="1" format="ascii">
-          0.49744 0.0069828 0.00447191 0.00385415 0.00354342 0.00335348 0.00322394 0.00311412 0.00302066 0.00296443 0.508341 0.0235742
-          0.0151997 0.0131001 0.012044 0.0113986 0.0109583 0.0105848 0.0102672 0.0100763 0.523281 0.0464825 0.030211 0.026038
-          0.0239389 0.0226565 0.0217814 0.0210386 0.0204074 0.0200285 0.543574 0.0779353 0.0512101 0.0441379 0.0405798 0.0384069
-          0.0369235 0.0356633 0.0345936 0.0339526 0.570792 0.120775 0.0805667 0.0694489 0.0638519 0.0604353 0.0581014 0.0561161
-          0.0544335 0.0534277 0.606623 0.178435 0.121536 0.10481 0.0963706 0.0912211 0.0877 0.0846992 0.0821611 0.0806494
-          0.652472 0.254594 0.178412 0.154066 0.141701 0.134155 0.128986 0.124568 0.120841 0.118632 0.708473 0.351832
-          0.256085 0.222001 0.204385 0.193605 0.186195 0.179826 0.174472 0.171323 0.77162 0.468019 0.35735 0.312765
-          0.288783 0.273975 0.26372 0.254804 0.247334 0.242987 0.83404 0.590855 0.476189 0.424429 0.394445 0.37558
-          0.36232 0.35052 0.340661 0.33502 0.889162 0.706026 0.596847 0.542871 0.509852 0.48831 0.472769 0.4584
-          0.44647 0.439857 0.935058 0.809425 0.710386 0.651094 0.615455 0.594486 0.578681 0.562704 0.54944 0.54248
-          0.968778 0.895645 0.817526 0.756573 0.715005 0.688274 0.667869 0.649414 0.635771 0.62994 0.988764 0.955507
-          0.907994 0.859757 0.817878 0.784447 0.757668 0.735657 0.719179 0.710496 0.997666 0.987407 0.966895 0.939938
-          0.910595 0.881891 0.85533 0.832194 0.812518 0.799081 1 0.998616 0.993478 0.984063 0.97094 0.955265
-          0.937832 0.920545 0.904026 0.891324 0.999779 1 1 0.998625 0.995728 0.991302 0.984825 0.977207
-          0.968875 0.961638 0.998939 0.998682 0.99964 1 1 1 0.999207 0.997831 0.99606 0.99416
-          0.998002 0.996955 0.998151 0.99876 0.999097 0.999743 1 1 1 1 0.997163 0.995215
-          0.996204 0.996508 0.996446 0.996652 0.996449 0.995979 0.995463 0.995147
+          0.496109 0.00683828 0.00439303 0.00380733 0.00351308 0.00333365 0.00321092 0.00310466 0.00301348 0.00295895 0.50681 0.0230817
+          0.0149319 0.012941 0.0119409 0.0113312 0.0109141 0.0105527 0.0102428 0.0100577 0.521466 0.0455015 0.0296793 0.0257218
+          0.023734 0.0225226 0.0216935 0.0209747 0.0203589 0.0199916 0.541359 0.0762707 0.0503104 0.043602 0.0402327 0.0381803
+          0.0367747 0.0355551 0.0345115 0.0338901 0.568019 0.11816 0.079155 0.0686064 0.0633061 0.0600791 0.0578675 0.055946
+          0.0543045 0.0533295 0.603089 0.174522 0.119416 0.10354 0.0955478 0.0906845 0.0873476 0.0844427 0.0819668 0.0805015
+          0.647944 0.248967 0.175326 0.152205 0.140495 0.133368 0.128469 0.124191 0.120556 0.118415 0.702778 0.344119
+          0.251741 0.219344 0.202656 0.192477 0.185453 0.179283 0.174061 0.17101 0.764827 0.458172 0.351546 0.309113
+          0.286384 0.272402 0.262677 0.254033 0.246747 0.242539 0.826652 0.579508 0.469063 0.41974 0.391298 0.373488
+          0.360907 0.349451 0.339833 0.334381 0.881735 0.693952 0.588779 0.537382 0.506041 0.485715 0.470958 0.456976
+          0.445336 0.438963 0.92837 0.797668 0.701756 0.645088 0.611254 0.591567 0.576561 0.560937 0.547981 0.541303
+          0.963761 0.885845 0.809185 0.750191 0.710298 0.684798 0.665262 0.647303 0.634063 0.628564 0.985867 0.949019
+          0.901431 0.85386 0.81299 0.780511 0.754573 0.733163 0.717155 0.708803 0.996607 0.984352 0.963178 0.935937
+          0.906764 0.878403 0.852306 0.829577 0.810272 0.797095 0.999959 0.997822 0.992268 0.982365 0.969012 0.953221
+          0.935824 0.918593 0.902181 0.889568 1 1 1 0.998353 0.995313 0.990743 0.98419 0.976454
+          0.968037 0.960744 0.998998 0.998549 0.999763 1 1 1 0.99925 0.997825 0.996002 0.994057
+          0.99782 0.996476 0.998072 0.998593 0.998962 0.999651 1 1 1 1 0.996771 0.994398
+          0.995853 0.996055 0.996004 0.996232 0.996104 0.995619 0.995089 0.994763
         </DataArray>
         <DataArray type="Float32" Name="p_rel" NumberOfComponents="1" format="ascii">
-          0.00144721 0.00101247 0.000821206 0.000677891 0.000552384 0.000439616 0.00033734 0.00023578 0.000135815 4.36355e-05 0.00144711 0.0010125
-          0.000821212 0.000677894 0.000552385 0.000439617 0.00033734 0.000235781 0.000135815 4.36357e-05 0.00144698 0.00101254 0.000821221 0.000677898
-          0.000552388 0.000439619 0.000337341 0.000235782 0.000135816 4.36359e-05 0.00144679 0.0010126 0.000821234 0.000677903 0.000552391 0.000439621
-          0.000337343 0.000235783 0.000135817 4.36363e-05 0.00144652 0.00101268 0.000821252 0.000677911 0.000552396 0.000439623 0.000337345 0.000235785
-          0.000135819 4.36368e-05 0.00144612 0.00101278 0.000821278 0.000677922 0.000552403 0.000439627 0.000337348 0.000235788 0.000135821 4.36374e-05
-          0.00144555 0.00101293 0.000821314 0.000677938 0.000552412 0.000439633 0.000337352 0.000235792 0.000135824 4.36384e-05 0.00144474 0.00101316
-          0.000821366 0.000677961 0.000552426 0.00043964 0.000337359 0.000235798 0.000135828 4.36398e-05 0.00144363 0.00101359 0.000821448 0.000677996
-          0.000552447 0.000439652 0.000337368 0.000235807 0.000135834 4.3642e-05 0.00144212 0.00101442 0.000821594 0.00067806 0.000552485 0.000439672
-          0.000337384 0.000235822 0.000135845 4.36459e-05 0.00143982 0.00101559 0.000821971 0.000678183 0.000552561 0.000439713 0.000337417 0.000235852
-          0.000135867 4.36545e-05 0.00143637 0.00101706 0.000822666 0.000678607 0.000552703 0.000439782 0.000337477 0.000235912 0.000135913 4.36743e-05
-          0.00143157 0.00101912 0.00082363 0.000679088 0.000553003 0.00044014 0.000337667 0.000236056 0.000135993 4.37008e-05 0.00142507 0.00102183
-          0.000824939 0.00067973 0.000553509 0.000440638 0.000337785 0.000236112 0.000136225 4.39644e-05 0.00141646 0.00102535 0.000826651 0.000680538
-          0.000554123 0.000441222 0.000337942 0.00023621 0.00013671 4.45452e-05 0.00140532 0.00102981 0.000828852 0.000681544 0.00055483 0.000441851
-          0.000338114 0.000236341 0.000137298 4.54213e-05 0.0013914 0.00103517 0.000831644 0.000682801 0.000555667 0.000442492 0.0003383 0.000236518
-          0.000137965 4.68155e-05 0.00137504 0.0010412 0.000834997 0.000684344 0.000556627 0.000443151 0.000338573 0.000236806 0.000138701 4.875e-05
-          0.00135783 0.00104719 0.000838632 0.000686022 0.000557654 0.000443835 0.000338914 0.000237182 0.000139442 5.0809e-05 0.00134424 0.00105172
-          0.000841631 0.000687435 0.000558517 0.000444396 0.000339197 0.000237493 0.000140062 5.23505e-05
+          0.0015242 0.000997341 0.000817586 0.000676103 0.000551477 0.000439401 0.00033759 0.000236002 0.000135866 4.36872e-05 0.00152409 0.000997373
+          0.000817593 0.000676106 0.000551479 0.000439402 0.000337591 0.000236003 0.000135866 4.36874e-05 0.00152394 0.000997415 0.000817601 0.000676109
+          0.000551481 0.000439403 0.000337592 0.000236004 0.000135867 4.36876e-05 0.00152371 0.000997472 0.000817613 0.000676115 0.000551484 0.000439405
+          0.000337593 0.000236005 0.000135868 4.36879e-05 0.00152339 0.000997548 0.000817631 0.000676122 0.000551489 0.000439407 0.000337595 0.000236007
+          0.00013587 4.36884e-05 0.00152292 0.000997652 0.000817655 0.000676133 0.000551495 0.000439411 0.000337598 0.00023601 0.000135872 4.3689e-05
+          0.00152224 0.000997801 0.00081769 0.000676148 0.000551504 0.000439416 0.000337602 0.000236014 0.000135874 4.369e-05 0.00152128 0.000998042
+          0.00081774 0.000676169 0.000551517 0.000439424 0.000337608 0.000236019 0.000135878 4.36913e-05 0.00151995 0.000998492 0.000817819 0.000676203
+          0.000551537 0.000439435 0.000337617 0.000236028 0.000135885 4.36933e-05 0.00151812 0.000999382 0.00081796 0.000676264 0.000551573 0.000439453
+          0.000337633 0.000236043 0.000135895 4.36971e-05 0.00151537 0.00100073 0.00081832 0.000676382 0.000551646 0.000439492 0.000337665 0.000236072
+          0.000135917 4.37052e-05 0.00151123 0.00100254 0.00081901 0.000676787 0.00055178 0.000439555 0.000337723 0.000236131 0.000135962 4.37239e-05
+          0.00150549 0.00100524 0.000819978 0.000677268 0.000552079 0.00043991 0.000337903 0.000236269 0.000136039 4.37475e-05 0.00149773 0.00100902
+          0.000821313 0.000677905 0.000552582 0.000440409 0.000338008 0.000236319 0.000136275 4.40112e-05 0.00148748 0.00101415 0.000823081 0.000678708
+          0.000553195 0.000440995 0.000338151 0.000236409 0.000136767 4.45964e-05 0.00147425 0.00102081 0.00082538 0.00067971 0.000553901 0.000441624
+          0.000338306 0.000236531 0.000137365 4.54734e-05 0.00145774 0.00102895 0.000828328 0.000680959 0.000554733 0.00044226 0.000338472 0.000236699
+          0.000138043 4.68639e-05 0.00143839 0.00103817 0.000831915 0.000682499 0.000555682 0.000442902 0.000338722 0.000236978 0.000138789 4.87941e-05
+          0.00141805 0.00104742 0.000835854 0.00068418 0.000556695 0.000443567 0.000339042 0.000237346 0.000139532 5.08474e-05 0.00140202 0.00105446
+          0.000839141 0.000685599 0.000557547 0.000444112 0.000339306 0.000237651 0.000140155 5.23807e-05
         </DataArray>
         <DataArray type="Float32" Name="nu" NumberOfComponents="1" format="ascii">
-          1.7181e-05 1.71948e-05 1.71974e-05 1.71983e-05 1.7199e-05 1.71994e-05 1.71996e-05 1.71999e-05 1.72001e-05 1.72002e-05 1.71197e-05 1.71652e-05
-          1.71738e-05 1.7177e-05 1.71794e-05 1.71805e-05 1.71815e-05 1.71824e-05 1.71832e-05 1.71836e-05 1.70365e-05 1.71236e-05 1.71407e-05 1.71472e-05
-          1.71519e-05 1.71542e-05 1.7156e-05 1.71579e-05 1.71596e-05 1.71603e-05 1.69254e-05 1.70656e-05 1.70945e-05 1.71056e-05 1.71135e-05 1.71174e-05
-          1.71205e-05 1.71236e-05 1.71266e-05 1.71277e-05 1.67792e-05 1.69845e-05 1.70299e-05 1.70473e-05 1.70597e-05 1.70658e-05 1.70708e-05 1.70757e-05
-          1.70803e-05 1.70822e-05 1.65915e-05 1.68716e-05 1.69397e-05 1.69659e-05 1.69846e-05 1.69938e-05 1.70012e-05 1.70087e-05 1.70157e-05 1.70185e-05
-          1.63578e-05 1.67157e-05 1.68142e-05 1.68524e-05 1.68799e-05 1.68933e-05 1.69043e-05 1.69152e-05 1.69255e-05 1.69296e-05 1.60793e-05 1.65052e-05
-          1.66414e-05 1.66956e-05 1.67349e-05 1.67541e-05 1.67698e-05 1.67855e-05 1.68003e-05 1.68061e-05 1.57672e-05 1.62368e-05 1.64114e-05 1.64842e-05
-          1.65386e-05 1.65649e-05 1.65868e-05 1.66088e-05 1.66295e-05 1.66376e-05 1.54465e-05 1.59306e-05 1.61282e-05 1.62172e-05 1.62882e-05 1.63216e-05
-          1.63505e-05 1.63799e-05 1.64077e-05 1.64182e-05 1.51444e-05 1.5611e-05 1.58231e-05 1.59166e-05 1.6002e-05 1.60398e-05 1.60753e-05 1.6112e-05
-          1.61469e-05 1.61588e-05 1.48767e-05 1.52775e-05 1.55133e-05 1.5626e-05 1.57204e-05 1.57544e-05 1.57943e-05 1.58367e-05 1.58779e-05 1.58889e-05
-          1.46608e-05 1.49522e-05 1.51814e-05 1.53347e-05 1.54433e-05 1.54921e-05 1.55415e-05 1.559e-05 1.56358e-05 1.56404e-05 1.45107e-05 1.46838e-05
-          1.48567e-05 1.50099e-05 1.51304e-05 1.52178e-05 1.52876e-05 1.53472e-05 1.53988e-05 1.54131e-05 1.44246e-05 1.4501e-05 1.45998e-05 1.47097e-05
-          1.48112e-05 1.49051e-05 1.49855e-05 1.50551e-05 1.51142e-05 1.51579e-05 1.43867e-05 1.44094e-05 1.44447e-05 1.44983e-05 1.45568e-05 1.46232e-05
-          1.46889e-05 1.47516e-05 1.48081e-05 1.48611e-05 1.43719e-05 1.43742e-05 1.43801e-05 1.43933e-05 1.44114e-05 1.44412e-05 1.44761e-05 1.45138e-05
-          1.45517e-05 1.45933e-05 1.4376e-05 1.43802e-05 1.4384e-05 1.43884e-05 1.43931e-05 1.44014e-05 1.4411e-05 1.44218e-05 1.44336e-05 1.4452e-05
-          1.43716e-05 1.43708e-05 1.43703e-05 1.43701e-05 1.43701e-05 1.43703e-05 1.4371e-05 1.43721e-05 1.43736e-05 1.43761e-05 1.43727e-05 1.43726e-05
-          1.43725e-05 1.43723e-05 1.43721e-05 1.43719e-05 1.43717e-05 1.43716e-05 1.43714e-05 1.43712e-05
+          1.71797e-05 1.71947e-05 1.71973e-05 1.71983e-05 1.7199e-05 1.71993e-05 1.71996e-05 1.71999e-05 1.72001e-05 1.72002e-05 1.71153e-05 1.71648e-05
+          1.71737e-05 1.7177e-05 1.71793e-05 1.71804e-05 1.71814e-05 1.71823e-05 1.71832e-05 1.71835e-05 1.70284e-05 1.7123e-05 1.71405e-05 1.71471e-05
+          1.71518e-05 1.7154e-05 1.71559e-05 1.71577e-05 1.71595e-05 1.71601e-05 1.69126e-05 1.70645e-05 1.70942e-05 1.71053e-05 1.71133e-05 1.71171e-05
+          1.71202e-05 1.71234e-05 1.71263e-05 1.71275e-05 1.67612e-05 1.69828e-05 1.70294e-05 1.70469e-05 1.70594e-05 1.70654e-05 1.70703e-05 1.70753e-05
+          1.70799e-05 1.70818e-05 1.6568e-05 1.6869e-05 1.69389e-05 1.69653e-05 1.69841e-05 1.69931e-05 1.70005e-05 1.70081e-05 1.70151e-05 1.70179e-05
+          1.63297e-05 1.67119e-05 1.6813e-05 1.68516e-05 1.68791e-05 1.68923e-05 1.69032e-05 1.69143e-05 1.69247e-05 1.69287e-05 1.60487e-05 1.64999e-05
+          1.66397e-05 1.66943e-05 1.67337e-05 1.67526e-05 1.67682e-05 1.67842e-05 1.67991e-05 1.68049e-05 1.57374e-05 1.62296e-05 1.64088e-05 1.64823e-05
+          1.65369e-05 1.65628e-05 1.65846e-05 1.66069e-05 1.66278e-05 1.66359e-05 1.54213e-05 1.59215e-05 1.61243e-05 1.62144e-05 1.62857e-05 1.63187e-05
+          1.63475e-05 1.63774e-05 1.64055e-05 1.64158e-05 1.51274e-05 1.56021e-05 1.58177e-05 1.59126e-05 1.59986e-05 1.60358e-05 1.60715e-05 1.61088e-05
+          1.61441e-05 1.61559e-05 1.48695e-05 1.52715e-05 1.5508e-05 1.56209e-05 1.57162e-05 1.57495e-05 1.57897e-05 1.58331e-05 1.58747e-05 1.58855e-05
+          1.46616e-05 1.49502e-05 1.51784e-05 1.53305e-05 1.54393e-05 1.54873e-05 1.5537e-05 1.55862e-05 1.56324e-05 1.56367e-05 1.45153e-05 1.46853e-05
+          1.48562e-05 1.50083e-05 1.5128e-05 1.52149e-05 1.52845e-05 1.5344e-05 1.53958e-05 1.54097e-05 1.4429e-05 1.4504e-05 1.46012e-05 1.47101e-05
+          1.48105e-05 1.4904e-05 1.4984e-05 1.50533e-05 1.51121e-05 1.51558e-05 1.4389e-05 1.44117e-05 1.44465e-05 1.44995e-05 1.45574e-05 1.46235e-05
+          1.46888e-05 1.47511e-05 1.48072e-05 1.48602e-05 1.43728e-05 1.43753e-05 1.43813e-05 1.43943e-05 1.44122e-05 1.44419e-05 1.44766e-05 1.45141e-05
+          1.45517e-05 1.45932e-05 1.43759e-05 1.43801e-05 1.43839e-05 1.43883e-05 1.4393e-05 1.44013e-05 1.44108e-05 1.44216e-05 1.44333e-05 1.44517e-05
+          1.43717e-05 1.43709e-05 1.43705e-05 1.43703e-05 1.43703e-05 1.43705e-05 1.43712e-05 1.43723e-05 1.43738e-05 1.43763e-05 1.43727e-05 1.43726e-05
+          1.43724e-05 1.43723e-05 1.43721e-05 1.43719e-05 1.43717e-05 1.43716e-05 1.43714e-05 1.43712e-05
         </DataArray>
         <DataArray type="Float32" Name="nu_t" NumberOfComponents="1" format="ascii">
-          4.39157e-14 1.06023e-13 4.54578e-14 3.44331e-14 2.95989e-14 2.68913e-14 2.52003e-14 2.38324e-14 2.27027e-14 2.20639e-14 5.80749e-12 1.40114e-11
-          6.05752e-12 4.58884e-12 3.94456e-12 3.58386e-12 3.35848e-12 3.17607e-12 3.02548e-12 2.94044e-12 8.85928e-11 2.14311e-10 9.42601e-11 7.14181e-11
-          6.13905e-11 5.57803e-11 5.22725e-11 4.94303e-11 4.70859e-11 4.57651e-11 7.07679e-10 1.71985e-09 7.74828e-10 5.87285e-10 5.04836e-10 4.58747e-10
-          4.29901e-10 4.06492e-10 3.87205e-10 3.76377e-10 4.13273e-09 1.01246e-08 4.71635e-09 3.57832e-09 3.07633e-09 2.79599e-09 2.62026e-09 2.47732e-09
-          2.35975e-09 2.29405e-09 1.99542e-08 4.95599e-08 2.41769e-08 1.83942e-08 1.58218e-08 1.43858e-08 1.34834e-08 1.27467e-08 1.21421e-08 1.18065e-08
-          8.36169e-08 2.12376e-07 1.10321e-07 8.45829e-08 7.28866e-08 6.63442e-08 6.22146e-08 5.88202e-08 5.60412e-08 5.45141e-08 3.06119e-07 8.03747e-07
-          4.53572e-07 3.54439e-07 3.07145e-07 2.80453e-07 2.63444e-07 2.49269e-07 2.37683e-07 2.31414e-07 9.54608e-07 2.6145e-06 1.63585e-06 1.32803e-06
-          1.16628e-06 1.07305e-06 1.01253e-06 9.60576e-07 9.18088e-07 8.95702e-07 2.50962e-06 7.16476e-06 4.98146e-06 4.24071e-06 3.81495e-06 3.55773e-06
-          3.38446e-06 3.22717e-06 3.09892e-06 3.03517e-06 3.99483e-06 1.11137e-05 1.29619e-05 1.11965e-05 1.0249e-05 9.78417e-06 9.44123e-06 9.0712e-06
-          8.76717e-06 8.63548e-06 3.98089e-06 1.10749e-05 1.81787e-05 2.67255e-05 2.42028e-05 2.28229e-05 2.1781e-05 2.09228e-05 2.03903e-05 2.03165e-05
-          3.87557e-06 1.07819e-05 1.81154e-05 2.84486e-05 2.98266e-05 4.36419e-05 4.58975e-05 4.5533e-05 4.40322e-05 4.33296e-05 3.21882e-06 8.95478e-06
-          1.76417e-05 2.83497e-05 2.97229e-05 4.3622e-05 4.58767e-05 4.70067e-05 4.69481e-05 6.6877e-05 1.40075e-06 3.8969e-06 1.46979e-05 2.76144e-05
-          2.8952e-05 4.34705e-05 4.57174e-05 4.68435e-05 4.67851e-05 6.68465e-05 2.6405e-07 7.3459e-07 6.46968e-06 2.30567e-05 2.41735e-05 4.23497e-05
-          4.45385e-05 4.56356e-05 4.55787e-05 6.66145e-05 3.68613e-08 1.02549e-07 1.23188e-06 1.02312e-05 1.07268e-05 3.54142e-05 3.72447e-05 3.81621e-05
-          3.81145e-05 6.4904e-05 4.9027e-09 1.36394e-08 1.72686e-07 1.96214e-06 2.05719e-06 1.58048e-05 1.66217e-05 1.70312e-05 1.70099e-05 5.4334e-05
-          6.48769e-10 1.80488e-09 2.30167e-08 2.75876e-07 2.89239e-07 3.04663e-06 3.2041e-06 3.28303e-06 3.27893e-06 2.43469e-05 8.5887e-11 2.38939e-10
-          3.04997e-09 3.68262e-08 3.86101e-08 4.29269e-07 4.51456e-07 4.62577e-07 4.62e-07 4.71049e-06
+          4.2535e-14 1.02681e-13 4.42878e-14 3.39166e-14 2.93572e-14 2.68067e-14 2.52071e-14 2.3884e-14 2.27796e-14 2.21604e-14 5.62519e-12 1.3568e-11
+          5.902e-12 4.52012e-12 3.91242e-12 3.57262e-12 3.35942e-12 3.18296e-12 3.03574e-12 2.9533e-12 8.5798e-11 2.07472e-10 9.18498e-11 7.03514e-11
+          6.0892e-11 5.56067e-11 5.22878e-11 4.9538e-11 4.72458e-11 4.59655e-11 6.85247e-10 1.6645e-09 7.55134e-10 5.78548e-10 5.00756e-10 4.57334e-10
+          4.30036e-10 4.07381e-10 3.88524e-10 3.78028e-10 4.00147e-09 9.79701e-09 4.59758e-09 3.52542e-09 3.05165e-09 2.78751e-09 2.62116e-09 2.48278e-09
+          2.36781e-09 2.30414e-09 1.93253e-08 4.79641e-08 2.35778e-08 1.81252e-08 1.56963e-08 1.43431e-08 1.34887e-08 1.27751e-08 1.21837e-08 1.18586e-08
+          8.10692e-08 2.05748e-07 1.07675e-07 8.33733e-08 7.23221e-08 6.61558e-08 6.22432e-08 5.89525e-08 5.62339e-08 5.47548e-08 2.97654e-07 7.80819e-07
+          4.43438e-07 3.49631e-07 3.04887e-07 2.79721e-07 2.63593e-07 2.49833e-07 2.38496e-07 2.32428e-07 9.33808e-07 2.55374e-06 1.6042e-06 1.31201e-06
+          1.15865e-06 1.07071e-06 1.01327e-06 9.62728e-07 9.21129e-07 8.99508e-07 2.47549e-06 7.04664e-06 4.90404e-06 4.19983e-06 3.79494e-06 3.55236e-06
+          3.38762e-06 3.23406e-06 3.10844e-06 3.04719e-06 4.10722e-06 1.1249e-05 1.28103e-05 1.11184e-05 1.02149e-05 9.78083e-06 9.45459e-06 9.08992e-06
+          8.7914e-06 8.66648e-06 4.09289e-06 1.12097e-05 1.83809e-05 2.65984e-05 2.41396e-05 2.28046e-05 2.17948e-05 2.09587e-05 2.04447e-05 2.03884e-05
+          3.98461e-06 1.09131e-05 1.83169e-05 2.88938e-05 3.00627e-05 4.43026e-05 4.63709e-05 4.55781e-05 4.41299e-05 4.34512e-05 3.30937e-06 9.06379e-06
+          1.78379e-05 2.87933e-05 2.99582e-05 4.42825e-05 4.63498e-05 4.73535e-05 4.72064e-05 6.76216e-05 1.44016e-06 3.94434e-06 1.48613e-05 2.80466e-05
+          2.91812e-05 4.41287e-05 4.61888e-05 4.7189e-05 4.70425e-05 6.75907e-05 2.71479e-07 7.43533e-07 6.54163e-06 2.34175e-05 2.43649e-05 4.29909e-05
+          4.49979e-05 4.59723e-05 4.58295e-05 6.73562e-05 3.78983e-08 1.03797e-07 1.24558e-06 1.03914e-05 1.08118e-05 3.59504e-05 3.76288e-05 3.84436e-05
+          3.83242e-05 6.56266e-05 5.04063e-09 1.38054e-08 1.74607e-07 1.99285e-06 2.07347e-06 1.60441e-05 1.67931e-05 1.71568e-05 1.71035e-05 5.49389e-05
+          6.67021e-10 1.82686e-09 2.32727e-08 2.80193e-07 2.91529e-07 3.09276e-06 3.23714e-06 3.30724e-06 3.29697e-06 2.4618e-05 8.83033e-11 2.41847e-10
+          3.08389e-09 3.74025e-08 3.89157e-08 4.35768e-07 4.56112e-07 4.65989e-07 4.64542e-07 4.76293e-06
         </DataArray>
         <DataArray type="Float32" Name="l_w" NumberOfComponents="1" format="ascii">
           0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000119663 0.000406853 0.000406853
@@ -251,255 +251,255 @@
           0.428486 0.428486 0.428486 0.428486 0.428486 0.428486 0.428486 0.428486
         </DataArray>
         <DataArray type="Float32" Name="y^+" NumberOfComponents="1" format="ascii">
-          0.056653 0.0706137 0.0571307 0.0532954 0.0513159 0.050099 0.0492915 0.0486081 0.0480211 0.0476794 0.193311 0.240502
-          0.194512 0.181429 0.174673 0.170523 0.167768 0.165436 0.163432 0.162267 0.386222 0.479333 0.38748 0.36135
-          0.347848 0.339561 0.334057 0.329395 0.325389 0.323063 0.65928 0.815646 0.658888 0.614292 0.591226 0.577086
-          0.56769 0.559725 0.552878 0.548911 1.04705 1.29033 1.04133 0.970483 0.933793 0.911343 0.896408 0.883737
-          0.872841 0.866542 1.59979 1.96248 1.58162 1.47325 1.41702 1.3827 1.35984 1.34041 1.3237 1.31408
-          2.39071 2.91838 2.34766 2.18521 2.10071 2.0493 2.015 1.9858 1.96066 1.94625 3.52603 4.28497
-          3.43893 3.19784 3.07195 2.99573 2.94473 2.90122 2.86371 2.84236 5.15762 6.24769 5.00171 4.64559
-          4.45851 4.34595 4.27034 4.2056 4.1497 4.11819 7.49664 9.06735 7.2472 6.72394 6.44626 6.2806
-          6.16857 6.0722 5.98879 5.94242 10.8332 13.1097 10.4659 9.70647 9.29645 9.05479 8.88933 8.74624
-          8.62203 8.55444 15.5702 18.9132 15.0715 13.9591 13.3604 13.0157 12.7738 12.5632 12.3794 12.2829
-          22.2521 27.2169 21.6909 20.0335 19.1546 18.6418 18.2833 17.974 17.7052 17.5742 31.6093 38.9656
-          31.1632 28.7759 27.4876 26.6821 26.1327 25.6707 25.2759 25.073 44.6522 55.407 44.5306 41.2331
-          39.4313 38.2542 37.4364 36.7473 36.1621 35.8013 62.8131 78.2315 63.1482 58.6948 56.2898 54.7063
-          53.5846 52.618 51.7849 51.2333 88.1646 109.961 88.9413 82.8992 79.7233 77.6732 76.2387 74.9872
-          73.8898 73.1553 123.53 154.05 124.621 116.226 111.877 109.163 107.334 105.768 104.407 103.533
-          173.131 215.98 174.772 163.051 157.001 153.279 150.803 148.703 146.895 145.824 242.499 302.503
-          244.782 228.364 219.894 214.686 211.232 208.309 205.798 204.338
+          0.0562032 0.0700503 0.0567594 0.0530943 0.0512108 0.0500595 0.0492948 0.0486344 0.0480617 0.0477315 0.191809 0.238586
+          0.193248 0.180745 0.174316 0.170389 0.16778 0.165526 0.163571 0.162445 0.383309 0.475524 0.384965 0.359989
+          0.347138 0.339296 0.334083 0.329576 0.325666 0.323418 0.654488 0.809186 0.654616 0.611982 0.590022 0.576641
+          0.567738 0.560036 0.553353 0.549517 1.03978 1.28016 1.03459 0.966842 0.9319 0.910648 0.896493 0.884236
+          0.873598 0.867507 1.58922 1.94711 1.57141 1.46774 1.41416 1.38166 1.35998 1.34119 1.32486 1.31556
+          2.37563 2.89574 2.33257 2.17708 2.0965 2.04781 2.01526 1.98698 1.96241 1.94847 3.50445 4.25213
+          3.41693 3.18601 3.06587 2.99363 2.9452 2.90302 2.86633 2.84567 5.12596 6.20055 4.96998 4.62858
+          4.44984 4.34308 4.27118 4.20835 4.15363 4.12312 7.44868 9.00008 7.20183 6.69972 6.43402 6.27679
+          6.1701 6.07641 5.99468 5.94976 10.7584 13.0125 10.4014 9.67227 9.27938 9.04987 8.89202 8.75267
+          8.63083 8.56533 15.4529 18.7696 14.9786 13.9109 13.3367 13.0095 12.7784 12.5728 12.3924 12.2989
+          22.0725 27.0033 21.5541 19.9634 19.1203 18.6329 18.2898 17.9881 17.724 17.5975 31.3459 38.6504
+          30.9615 28.6705 27.4356 26.6662 26.1398 25.6899 25.3023 25.1058 44.2808 54.953 44.2367 41.0764
+          39.3521 38.2269 37.4426 36.7716 36.1976 35.8455 62.2996 77.5944 62.7299 58.4681 56.1721 54.6622
+          53.5886 52.6482 51.8317 51.2924 87.4523 109.075 88.3561 82.5803 79.5554 77.6082 76.2411 75.0264
+          73.9524 73.2355 122.54 152.821 123.812 115.788 111.648 109.078 107.342 105.827 104.497 103.648
+          171.742 214.254 173.634 162.434 156.678 153.155 150.811 148.781 147.017 145.981 240.555 300.088
+          243.19 227.503 219.443 214.517 211.246 208.421 205.972 204.561
         </DataArray>
         <DataArray type="Float32" Name="u^+" NumberOfComponents="1" format="ascii">
-          6.20443 0.0713257 0.0571562 0.0533186 0.0513378 0.0501192 0.0493113 0.0486287 0.0480411 0.0476978 6.3404 0.240799
-          0.19427 0.181228 0.174496 0.170357 0.167611 0.165288 0.163292 0.162128 6.52673 0.474795 0.386131 0.360211
-          0.346832 0.338611 0.333153 0.328529 0.324562 0.322259 6.77985 0.796069 0.654524 0.610606 0.58793 0.574008
-          0.564758 0.556902 0.550182 0.546298 7.11933 1.23365 1.02973 0.960761 0.925101 0.903232 0.88868 0.876284
-          0.865719 0.859653 7.56625 1.82263 1.55337 1.44995 1.39624 1.36334 1.3414 1.32263 1.3067 1.29765
-          8.1381 2.60054 2.2803 2.13136 2.053 2.00501 1.97289 1.94519 1.92187 1.90879 8.83659 3.59379
-          3.27306 3.07118 2.96117 2.89351 2.84792 2.80809 2.77484 2.75658 9.62421 4.78057 4.56735 4.32681
-          4.18395 4.09468 4.03368 3.9789 3.93364 3.90966 10.4028 6.03527 6.08624 5.87157 5.71482 5.61322
-          5.5418 5.47357 5.41793 5.39047 11.0903 7.2117 7.62838 7.51011 7.38685 7.29802 7.23116 7.15818
-          7.10074 7.07731 11.6627 8.26786 9.07954 9.00727 8.91685 8.88485 8.85112 8.78694 8.73839 8.72851
-          12.0833 9.14855 10.4489 10.4665 10.3592 10.2866 10.2153 10.141 10.1114 10.1357 12.3326 9.76002
-          11.6052 11.8939 11.8496 11.7239 11.5888 11.4877 11.4379 11.4319 12.4436 10.0859 12.358 13.0032
-          13.1929 13.1802 13.0826 12.9952 12.9224 12.8572 12.4727 10.2003 12.6978 13.6136 14.0672 14.2769
-          14.3444 14.3748 14.3778 14.3414 12.47 10.2145 12.7811 13.815 14.4263 14.8154 15.0632 15.2596
-          15.4092 15.4728 12.4595 10.201 12.7765 13.8341 14.4882 14.9454 15.2832 15.5817 15.8415 15.996
-          12.4478 10.1834 12.7575 13.8169 14.4752 14.9416 15.2953 15.6156 15.9042 16.09 12.4373 10.1656
-          12.7326 13.7858 14.4367 14.8954 15.241 15.5528 15.832 16.0119
+          6.25368 0.0707767 0.0567831 0.0531172 0.0512325 0.0500795 0.0493145 0.048655 0.0480817 0.0477497 6.38857 0.238897
+          0.193006 0.180544 0.174138 0.170222 0.167622 0.165377 0.16343 0.162305 6.57331 0.470944 0.383627 0.358852
+          0.346122 0.338345 0.333176 0.328707 0.324837 0.322611 6.82408 0.789408 0.650299 0.608306 0.586729 0.57356
+          0.564799 0.557205 0.550649 0.546896 7.16014 1.22297 1.02314 0.957148 0.923217 0.902533 0.888749 0.876762
+          0.866457 0.860597 7.60221 1.80632 1.54354 1.44452 1.39341 1.3623 1.34152 1.32335 1.30782 1.29908
+          8.16763 2.57683 2.26622 2.12346 2.04889 2.00352 1.97308 1.94627 1.92353 1.91091 8.85883 3.56166
+          3.25394 3.06013 2.95541 2.89147 2.84825 2.80965 2.77723 2.75965 9.64099 4.74211 4.54399 4.31253
+          4.17644 4.09214 4.03429 3.9811 3.93698 3.91394 10.4203 5.99796 6.06299 5.85592 5.70645 5.61069
+          5.54294 5.47646 5.42222 5.39603 11.1147 7.18246 7.61041 7.49718 7.3798 7.29661 7.23315 7.16154
+          7.10557 7.0837 11.7025 8.25593 9.07071 8.99982 8.91416 8.88677 8.85503 8.79078 8.74332 8.73521
+          12.1486 9.16856 10.4593 10.4661 10.3585 10.2873 10.2173 10.1443 10.1168 10.1434 12.4273 9.82243
+          11.6517 11.9125 11.8561 11.7252 11.589 11.4898 11.4426 11.4382 12.5627 10.1881 12.4498 13.0575
+          13.2237 13.1957 13.09 13.0008 12.9283 12.863 12.6049 10.3275 12.8258 13.7053 14.1315 14.3197
+          14.3727 14.3958 14.3948 14.3553 12.6055 10.3501 12.9257 13.9283 14.515 14.8834 15.1155 15.3026
+          15.4455 15.5039 12.5928 10.3351 12.9227 13.9513 14.5834 15.0224 15.3468 15.6375 15.8917 16.0415
+          12.578 10.3136 12.9008 13.9317 14.5682 15.0172 15.3584 15.6716 15.9555 16.1374 12.5648 10.2921
+          12.8721 13.8963 14.5251 14.9658 15.2985 15.6029 15.8772 16.0528
         </DataArray>
         <DataArray type="Float32" Name="temperature" NumberOfComponents="1" format="ascii">
-          312.882 313.023 313.049 313.059 313.066 313.07 313.072 313.075 313.078 313.079 312.253 312.719
-          312.807 312.841 312.865 312.877 312.886 312.896 312.905 312.909 311.399 312.293 312.469 312.536
-          312.583 312.607 312.626 312.645 312.663 312.67 310.255 311.698 311.994 312.108 312.189 312.229
-          312.261 312.293 312.324 312.336 308.746 310.864 311.331 311.51 311.637 311.7 311.751 311.802
-          311.849 311.868 306.801 309.701 310.402 310.672 310.865 310.959 311.036 311.113 311.185 311.214
-          304.369 308.089 309.108 309.503 309.786 309.925 310.038 310.151 310.256 310.299 301.453 305.905
-          307.32 307.881 308.288 308.487 308.649 308.812 308.964 309.025 298.163 303.104 304.928 305.686
-          306.252 306.526 306.752 306.981 307.196 307.281 294.755 299.888 301.966 302.899 303.641 303.991
-          304.293 304.6 304.89 305 291.521 296.506 298.754 299.741 300.64 301.038 301.411 301.796
-          302.163 302.288 288.636 292.949 295.467 296.665 297.667 298.027 298.449 298.897 299.333 299.449
-          286.294 289.452 291.919 293.562 294.721 295.241 295.768 296.283 296.77 296.819 284.658 286.544
-          288.419 290.074 291.371 292.31 293.058 293.695 294.247 294.4 283.717 284.552 285.63 286.826
-          287.926 288.944 289.811 290.562 291.197 291.668 283.302 283.55 283.937 284.523 285.161 285.886
-          286.601 287.281 287.895 288.469 283.14 283.166 283.232 283.376 283.574 283.902 284.283 284.696
-          285.109 285.563 283.204 283.247 283.287 283.335 283.386 283.475 283.579 283.697 283.825 284.025
-          283.138 283.13 283.125 283.123 283.123 283.126 283.134 283.146 283.162 283.19 283.149 283.148
-          283.146 283.144 283.142 283.14 283.138 283.137 283.135 283.133
+          312.868 313.022 313.049 313.059 313.066 313.069 313.072 313.075 313.078 313.079 312.208 312.716
+          312.806 312.84 312.864 312.876 312.885 312.895 312.904 312.908 311.316 312.287 312.467 312.534
+          312.582 312.605 312.624 312.643 312.661 312.668 310.123 311.686 311.991 312.105 312.187 312.226
+          312.258 312.291 312.321 312.333 308.56 310.846 311.325 311.506 311.634 311.695 311.746 311.797
+          311.845 311.864 306.558 309.674 310.394 310.666 310.859 310.952 311.029 311.107 311.179 311.208
+          304.075 308.05 309.095 309.494 309.778 309.914 310.027 310.141 310.248 310.29 301.131 305.85
+          307.301 307.868 308.276 308.471 308.633 308.798 308.952 309.012 297.847 303.029 304.901 305.667
+          306.234 306.503 306.73 306.962 307.179 307.262 294.487 299.792 301.925 302.87 303.616 303.96
+          304.262 304.574 304.867 304.975 291.339 296.411 298.696 299.698 300.604 300.996 301.371 301.763
+          302.133 302.257 288.558 292.885 295.411 296.612 297.622 297.975 298.4 298.859 299.299 299.413
+          286.302 289.43 291.887 293.516 294.678 295.19 295.72 296.243 296.734 296.78 284.709 286.56
+          288.414 290.057 291.346 292.278 293.024 293.661 294.215 294.364 283.765 284.585 285.646 286.83
+          287.92 288.932 289.795 290.542 291.176 291.645 283.327 283.575 283.957 284.536 285.168 285.888
+          286.599 287.276 287.885 288.459 283.15 283.178 283.244 283.388 283.583 283.909 284.288 284.698
+          285.109 285.562 283.203 283.246 283.286 283.333 283.384 283.474 283.577 283.694 283.821 284.022
+          283.138 283.131 283.127 283.125 283.125 283.128 283.136 283.148 283.164 283.193 283.149 283.147
+          283.146 283.144 283.142 283.14 283.138 283.136 283.135 283.133
         </DataArray>
         <DataArray type="Float32" Name="lambda_t" NumberOfComponents="1" format="ascii">
-          5.78376e-11 1.39571e-10 5.98372e-11 4.53238e-11 3.89597e-11 3.53956e-11 3.31695e-11 3.13689e-11 2.98818e-11 2.90411e-11 7.66369e-09 1.84626e-08
-          7.97973e-09 6.04436e-09 5.19532e-09 4.72008e-09 4.42313e-09 4.18279e-09 3.98436e-09 3.87234e-09 1.17224e-07 2.82774e-07 1.24303e-07 9.41611e-08
-          8.09282e-08 7.35272e-08 6.88994e-08 6.51495e-08 6.20562e-08 6.03145e-08 9.39777e-07 2.27353e-06 1.02331e-06 7.75348e-07 6.66326e-07 6.0542e-07
-          5.67294e-07 5.36351e-07 5.10856e-07 4.96553e-07 5.5145e-06 1.34193e-05 6.24191e-06 4.7331e-06 4.06748e-06 3.69608e-06 3.46323e-06 3.2738e-06
-          3.11797e-06 3.031e-06 2.67918e-05 6.59298e-05 3.20912e-05 2.43948e-05 2.09703e-05 1.90614e-05 1.78615e-05 1.68815e-05 1.60772e-05 1.56315e-05
-          0.000113152 0.000283977 0.000147037 0.000112592 9.69352e-05 8.81956e-05 8.26764e-05 7.81379e-05 7.44215e-05 7.23843e-05 0.000418194 0.00108228
-          0.000607986 0.000474253 0.000410438 0.000374532 0.000351637 0.000332544 0.000316935 0.000308517 0.00131829 0.00355255 0.00220968 0.0017895
-          0.00156869 0.00144203 0.00135971 0.001289 0.00123114 0.0012008 0.00350524 0.00983823 0.00679385 0.00576604 0.00517466 0.0048203
-          0.00458108 0.00436386 0.00418652 0.00409898 0.00564076 0.0154322 0.0178651 0.0153818 0.0140387 0.0133845 0.0128996 0.0123785
-          0.0119494 0.0117651 0.00567658 0.0155626 0.0253302 0.0370909 0.0334782 0.0315319 0.0300506 0.0288241 0.0280502 0.0279381
-          0.0055711 0.0153317 0.0255448 0.0398941 0.0416641 0.0608565 0.0638897 0.0632738 0.0610894 0.0601052 0.0046533 0.0128613
-          0.025175 0.0402273 0.0419906 0.061431 0.0644436 0.0658897 0.0656859 0.0935216 0.00203165 0.00563567 0.0211766 0.0396226
-          0.0413851 0.0619224 0.0649305 0.0663605 0.0661351 0.0943438 0.000383534 0.00106607 0.00937646 0.033348 0.034886 0.0609642
-          0.0639574 0.0653798 0.0651611 0.0950481 5.35723e-05 0.000149027 0.00178981 0.0148577 0.0155668 0.051335 0.0539171 0.0551664
-          0.0550188 0.0935432 7.12678e-06 1.98229e-05 0.000250932 0.00285066 0.00298814 0.0229493 0.0241262 0.0247098 0.0246675 0.0787376
-          9.42909e-07 2.6233e-06 3.34545e-05 0.000400989 0.000420416 0.00442833 0.00465712 0.00477165 0.00476545 0.0353814 1.24818e-07 3.47247e-07
-          4.43253e-06 5.35199e-05 5.61129e-05 0.000623871 0.000656122 0.000672289 0.000671455 0.00684613
+          5.60217e-11 1.35172e-10 5.82972e-11 4.46439e-11 3.86416e-11 3.52841e-11 3.31784e-11 3.14368e-11 2.9983e-11 2.9168e-11 7.42417e-09 1.78786e-08
+          7.77488e-09 5.95386e-09 5.15301e-09 4.7053e-09 4.42437e-09 4.19187e-09 3.99788e-09 3.88929e-09 1.13556e-07 2.73755e-07 1.21126e-07 9.27553e-08
+          8.02713e-08 7.32988e-08 6.892e-08 6.52916e-08 6.22673e-08 6.05789e-08 9.10367e-07 2.20043e-06 9.97312e-07 7.63819e-07 6.60946e-07 6.03561e-07
+          5.67478e-07 5.37529e-07 5.12599e-07 4.98735e-07 5.34253e-06 1.29858e-05 6.08483e-06 4.66318e-06 4.03489e-06 3.68493e-06 3.46449e-06 3.28105e-06
+          3.12866e-06 3.04436e-06 2.59677e-05 6.38124e-05 3.12968e-05 2.40384e-05 2.08045e-05 1.90053e-05 1.78689e-05 1.69194e-05 1.61326e-05 1.57007e-05
+          0.000109809 0.00027515 0.000143517 0.000110985 9.61871e-05 8.79481e-05 8.27172e-05 7.83159e-05 7.46794e-05 7.27059e-05 0.000407058 0.00105159
+          0.000594437 0.000467839 0.000407437 0.000373573 0.000351854 0.000333312 0.000318031 0.000309883 0.00129091 0.00347083 0.00216712 0.00176803
+          0.00155851 0.00143898 0.0013608 0.00129197 0.00123529 0.00120598 0.00346067 0.00967907 0.00668917 0.00571101 0.00514796 0.00481351
+          0.00458583 0.00437355 0.0041997 0.00411553 0.00580304 0.015625 0.0176596 0.0152766 0.0139935 0.0133817 0.0129196 0.0124054
+          0.0119835 0.0118086 0.00583784 0.0157555 0.0256167 0.0369211 0.0333958 0.0315122 0.0300745 0.028877 0.0281282 0.0280403
+          0.00572766 0.0155195 0.0258317 0.0405246 0.042 0.0617885 0.0645588 0.063345 0.0612322 0.0602818 0.00478337 0.0130171
+          0.0254554 0.0408594 0.0423267 0.0623678 0.0651155 0.0663834 0.0660545 0.0945742 0.00208846 0.00570362 0.0214109 0.0402422
+          0.0417136 0.0628625 0.0656037 0.0668544 0.0665039 0.0954017 0.00039429 0.00107896 0.0094801 0.0338683 0.0351614 0.0618867
+          0.0646173 0.0658632 0.0655217 0.0961096 5.50775e-05 0.000150835 0.00180964 0.0150896 0.0156895 0.0521108 0.0544721 0.0555727
+          0.0553215 0.0945849 7.32726e-06 2.00642e-05 0.000253722 0.00289527 0.0030118 0.0232968 0.0243751 0.0248922 0.0248035 0.079615
+          9.69437e-07 2.65523e-06 3.38265e-05 0.000407263 0.000423741 0.00449536 0.00470511 0.00480681 0.00479164 0.035775 1.2833e-07 3.51475e-07
+          4.48183e-06 5.43576e-05 5.65571e-05 0.000633317 0.000662888 0.000677248 0.000675149 0.00692235
         </DataArray>
         <DataArray type="Float32" Name="D_t" NumberOfComponents="1" format="ascii">
-          6.27366e-14 1.51461e-13 6.49397e-14 4.91902e-14 4.22841e-14 3.84162e-14 3.60004e-14 3.40463e-14 3.24324e-14 3.15199e-14 8.29641e-12 2.00162e-11
-          8.65361e-12 6.55549e-12 5.63508e-12 5.1198e-12 4.79783e-12 4.53725e-12 4.32211e-12 4.20063e-12 1.26561e-10 3.06159e-10 1.34657e-10 1.02026e-10
-          8.77007e-11 7.96862e-11 7.4675e-11 7.06148e-11 6.72655e-11 6.53788e-11 1.01097e-09 2.45693e-09 1.1069e-09 8.38979e-10 7.21194e-10 6.55353e-10
-          6.14144e-10 5.80702e-10 5.53151e-10 5.37681e-10 5.90389e-09 1.44638e-08 6.73765e-09 5.11189e-09 4.39476e-09 3.99427e-09 3.74322e-09 3.53903e-09
-          3.37107e-09 3.27722e-09 2.8506e-08 7.07998e-08 3.45384e-08 2.62775e-08 2.26025e-08 2.05511e-08 1.9262e-08 1.82096e-08 1.73458e-08 1.68665e-08
-          1.19453e-07 3.03394e-07 1.57601e-07 1.20833e-07 1.04124e-07 9.47775e-08 8.8878e-08 8.40289e-08 8.00588e-08 7.78774e-08 4.37313e-07 1.14821e-06
-          6.4796e-07 5.06342e-07 4.38779e-07 4.00647e-07 3.76349e-07 3.56098e-07 3.39547e-07 3.30591e-07 1.36373e-06 3.73501e-06 2.33693e-06 1.89718e-06
-          1.66612e-06 1.53293e-06 1.44647e-06 1.37225e-06 1.31155e-06 1.27957e-06 3.58518e-06 1.02354e-05 7.11637e-06 6.05815e-06 5.44993e-06 5.08247e-06
-          4.83494e-06 4.61025e-06 4.42703e-06 4.33596e-06 5.7069e-06 1.58767e-05 1.8517e-05 1.59949e-05 1.46415e-05 1.39774e-05 1.34875e-05 1.29589e-05
-          1.25245e-05 1.23364e-05 5.68699e-06 1.58213e-05 2.59696e-05 3.81793e-05 3.45754e-05 3.26041e-05 3.11157e-05 2.98898e-05 2.9129e-05 2.90236e-05
-          5.53654e-06 1.54027e-05 2.58792e-05 4.06408e-05 4.26095e-05 6.23455e-05 6.55679e-05 6.50472e-05 6.29032e-05 6.18995e-05 4.59831e-06 1.27925e-05
-          2.52024e-05 4.04995e-05 4.24613e-05 6.23172e-05 6.55381e-05 6.71525e-05 6.70687e-05 9.55386e-05 2.00107e-06 5.56701e-06 2.09969e-05 3.94491e-05
-          4.136e-05 6.21008e-05 6.53105e-05 6.69193e-05 6.68358e-05 9.5495e-05 3.77214e-07 1.04941e-06 9.2424e-06 3.29381e-05 3.45336e-05 6.04995e-05
-          6.36265e-05 6.51938e-05 6.51125e-05 9.51636e-05 5.2659e-08 1.46498e-07 1.75983e-06 1.46161e-05 1.53241e-05 5.05918e-05 5.32067e-05 5.45173e-05
-          5.44493e-05 9.272e-05 7.00386e-09 1.94848e-08 2.46694e-07 2.80306e-06 2.93884e-06 2.25783e-05 2.37453e-05 2.43302e-05 2.42999e-05 7.762e-05
-          9.26813e-10 2.5784e-09 3.2881e-08 3.94108e-07 4.13199e-07 4.35233e-06 4.57729e-06 4.69004e-06 4.68419e-06 3.47813e-05 1.22696e-10 3.41341e-10
-          4.3571e-09 5.26089e-08 5.51572e-08 6.13241e-07 6.44937e-07 6.60824e-07 6.6e-07 6.72927e-06
+          6.07642e-14 1.46686e-13 6.32683e-14 4.84522e-14 4.19389e-14 3.82952e-14 3.60101e-14 3.412e-14 3.25423e-14 3.16576e-14 8.03599e-12 1.93829e-11
+          8.43143e-12 6.45732e-12 5.58917e-12 5.10375e-12 4.79917e-12 4.54709e-12 4.33677e-12 4.219e-12 1.22569e-10 2.96388e-10 1.31214e-10 1.00502e-10
+          8.69885e-11 7.94382e-11 7.46969e-11 7.07685e-11 6.7494e-11 6.5665e-11 9.78925e-10 2.37785e-09 1.07876e-09 8.26498e-10 7.15366e-10 6.53335e-10
+          6.14338e-10 5.81973e-10 5.55034e-10 5.4004e-10 5.71639e-09 1.39957e-08 6.56797e-09 5.03631e-09 4.3595e-09 3.98215e-09 3.74452e-09 3.54682e-09
+          3.38259e-09 3.29163e-09 2.76075e-08 6.85202e-08 3.36826e-08 2.58931e-08 2.24233e-08 2.04902e-08 1.92696e-08 1.82501e-08 1.74053e-08 1.69408e-08
+          1.15813e-07 2.93926e-07 1.53822e-07 1.19105e-07 1.03317e-07 9.45083e-08 8.89188e-08 8.42178e-08 8.03341e-08 7.82212e-08 4.2522e-07 1.11546e-06
+          6.33483e-07 4.99473e-07 4.35554e-07 3.99601e-07 3.76562e-07 3.56905e-07 3.40708e-07 3.32041e-07 1.33401e-06 3.6482e-06 2.29171e-06 1.8743e-06
+          1.65521e-06 1.52959e-06 1.44753e-06 1.37533e-06 1.3159e-06 1.28501e-06 3.53641e-06 1.00666e-05 7.00578e-06 5.99976e-06 5.42135e-06 5.0748e-06
+          4.83946e-06 4.62009e-06 4.44063e-06 4.35312e-06 5.86746e-06 1.60699e-05 1.83005e-05 1.58834e-05 1.45926e-05 1.39726e-05 1.35066e-05 1.29856e-05
+          1.25591e-05 1.23807e-05 5.84699e-06 1.60139e-05 2.62584e-05 3.79978e-05 3.44851e-05 3.25781e-05 3.11355e-05 2.99409e-05 2.92067e-05 2.91263e-05
+          5.6923e-06 1.55902e-05 2.6167e-05 4.12768e-05 4.29468e-05 6.32895e-05 6.62441e-05 6.51116e-05 6.30427e-05 6.20732e-05 4.72767e-06 1.29483e-05
+          2.54827e-05 4.11333e-05 4.27974e-05 6.32607e-05 6.6214e-05 6.76478e-05 6.74377e-05 9.66023e-05 2.05737e-06 5.63478e-06 2.12305e-05 4.00665e-05
+          4.16874e-05 6.3041e-05 6.5984e-05 6.74129e-05 6.72035e-05 9.65582e-05 3.87827e-07 1.06219e-06 9.34519e-06 3.34536e-05 3.4807e-05 6.14155e-05
+          6.42826e-05 6.56747e-05 6.54707e-05 9.62231e-05 5.41405e-08 1.48281e-07 1.7794e-06 1.48448e-05 1.54454e-05 5.13578e-05 5.37554e-05 5.49194e-05
+          5.47489e-05 9.37523e-05 7.2009e-09 1.9722e-08 2.49438e-07 2.84693e-06 2.96211e-06 2.29202e-05 2.39902e-05 2.45097e-05 2.44336e-05 7.84841e-05
+          9.52888e-10 2.60979e-09 3.32467e-08 4.00276e-07 4.1647e-07 4.41823e-06 4.62449e-06 4.72463e-06 4.70996e-06 3.51686e-05 1.26148e-10 3.45496e-10
+          4.40556e-09 5.34322e-08 5.55939e-08 6.22526e-07 6.51588e-07 6.65698e-07 6.63631e-07 6.80419e-06
         </DataArray>
         <DataArray type="Float32" Name="dv_x/dx_" NumberOfComponents="3" format="ascii">
-          -0.082907 3.85104 0 -0.0416655 5.98769 0 -0.000262765 3.91998 0 -7.55312e-05 3.41153 0
-          -3.95913e-05 3.16293 0 -2.44022e-05 3.01476 0 -1.76194e-05 2.91841 0 -1.48017e-05 2.83808 0
-          -1.07206e-05 2.76999 0 -7.85059e-06 2.73073 0 -0.0818843 3.8036 0 -0.041649 5.9396 0
-          -0.000879306 3.91882 0 -0.000256712 3.41053 0 -0.000134547 3.16202 0 -8.29238e-05 3.01394 0
-          -5.9903e-05 2.91761 0 -5.03224e-05 2.83725 0 -3.64128e-05 2.76919 0 -2.6641e-05 2.73001 0
-          -0.0804533 3.70434 0 -0.0415994 5.83881 0 -0.00171541 3.91617 0 -0.000510222 3.40838 0
-          -0.000267388 3.16005 0 -0.000164785 3.01217 0 -0.000119107 2.91591 0 -0.000100055 2.83547 0
-          -7.23157e-05 2.76747 0 -5.28525e-05 2.72848 0 -0.0784515 3.56806 0 -0.0414787 5.6997 0
-          -0.00283369 3.9116 0 -0.000864732 3.4051 0 -0.000453152 3.15711 0 -0.000279245 3.00956 0
-          -0.000201999 2.9134 0 -0.000169685 2.83286 0 -0.000122448 2.76497 0 -8.936e-05 2.72623 0
-          -0.0756537 3.38213 0 -0.0412126 5.5074 0 -0.00429865 3.90206 0 -0.00135962 3.3993 0
-          -0.00071268 3.15217 0 -0.000439148 3.00522 0 -0.000318035 2.9093 0 -0.000267157 2.82867 0
-          -0.00019236 2.76097 0 -0.000140089 2.7226 0 -0.0717522 3.12967 0 -0.0406592 5.23805 0
-          -0.00615626 3.87782 0 -0.00204664 3.38635 0 -0.00107426 3.14177 0 -0.000662025 2.99627 0
-          -0.000480269 2.90102 0 -0.000403475 2.82048 0 -0.000289615 2.75321 0 -0.00021029 2.71548 0
-          -0.0663493 2.7875 0 -0.0395618 4.84803 0 -0.0083845 3.80893 0 -0.00298374 3.34998 0
-          -0.00157339 3.11366 0 -0.000970368 2.97235 0 -0.000705929 2.87929 0 -0.000593318 2.79973 0
-          -0.000424047 2.73369 0 -0.000306579 2.69724 0 -0.0590216 2.32924 0 -0.0375039 4.26228 0
-          -0.010784 3.61824 0 -0.00419441 3.24035 0 -0.00224081 3.02845 0 -0.00138604 2.89943 0
-          -0.00101353 2.81332 0 -0.000853258 2.73788 0 -0.000606205 2.67568 0 -0.000435472 2.64225 0
-          -0.0496292 1.75337 0 -0.0339871 3.40962 0 -0.0128041 3.17902 0 -0.00553448 2.95229 0
-          -0.00304785 2.79529 0 -0.00190079 2.69543 0 -0.00140459 2.62684 0 -0.00118857 2.56314 0
-          -0.000837611 2.51096 0 -0.00059568 2.48443 0 -0.0389652 1.17236 0 -0.0288719 2.4251 0
-          -0.013553 2.47079 0 -0.00651779 2.39711 0 -0.00379606 2.32239 0 -0.00240595 2.26767 0
-          -0.00181447 2.22707 0 -0.0015549 2.18373 0 -0.0010828 2.14912 0 -0.000756736 2.13422 0
-          -0.0283911 0.719678 0 -0.0229807 1.59076 0 -0.0130414 1.7258 0 -0.00679245 1.68662 0
-          -0.00414513 1.6584 0 -0.00270873 1.6543 0 -0.00211613 1.6464 0 -0.0018494 1.6256 0
-          -0.00125728 1.60942 0 -0.000848282 1.60644 0 -0.0182905 0.405147 0 -0.016932 0.985743 0
-          -0.0124153 1.16156 0 -0.00731758 1.13584 0 -0.00417968 1.09958 0 -0.00254831 1.0794 0
-          -0.00215507 1.06044 0 -0.00199382 1.04529 0 -0.00131018 1.04234 0 -0.000827536 1.05134 0
-          -0.00909878 0.195213 0 -0.0104135 0.542442 0 -0.0105477 0.742947 0 -0.00782218 0.79218 0
-          -0.00508283 0.774968 0 -0.00335905 0.732433 0 -0.00268275 0.694903 0 -0.00215021 0.67604 0
-          -0.00115677 0.667587 0 -0.000549074 0.66378 0 -0.00213749 0.0750017 0 -0.00419177 0.243384 0
-          -0.00660642 0.401129 0 -0.00657277 0.49724 0 -0.0055694 0.534862 0 -0.00441062 0.533232 0
-          -0.00346677 0.519857 0 -0.00262919 0.510321 0 -0.00159533 0.496534 0 -0.00100461 0.477303 0
-          0.00186756 0.0208371 0 0.000206514 0.0816702 0 -0.00228114 0.163977 0 -0.00346733 0.240775 0
-          -0.00391081 0.298975 0 -0.00384767 0.336032 0 -0.00342881 0.356872 0 -0.00290968 0.368718 0
-          -0.00223196 0.370921 0 -0.00180155 0.364488 0 0.0034092 0.00279834 0 0.0023339 0.0170415 0
-          0.000647106 0.0453593 0 -0.000418306 0.0811963 0 -0.00122673 0.118779 0 -0.00177113 0.153737 0
-          -0.00197662 0.18322 0 -0.00198868 0.20657 0 -0.00178815 0.224109 0 -0.00159114 0.234041 0
-          0.00368571 -0.00100428 0 0.00292298 6.37425e-05 0 0.00181355 0.00603023 0 0.00121869 0.0157501 0
-          0.000719125 0.02896 0 0.00026529 0.0448986 0 -5.67572e-05 0.0620279 0 -0.000299937 0.0786387 0
-          -0.000478563 0.0942247 0 -0.000533624 0.105756 0 0.00360007 -0.00120094 0 0.00296247 -0.00210259 0
-          0.00204876 -0.00129253 0 0.0016306 9.52903e-05 0 0.00137785 0.00239821 0 0.00118366 0.00605185 0
-          0.00103824 0.0109541 0 0.000888273 0.0165654 0 0.000634879 0.0227614 0 0.000469539 0.0281799 0
-          0.00346012 -0.000857128 0 0.00291152 -0.00170988 0 0.0020885 -0.00171532 0 0.0016804 -0.00176073 0
-          0.00146428 -0.00180688 0 0.00133561 -0.00171459 0 0.00125846 -0.00142216 0 0.00117713 -0.000961449 0
-          0.000974384 -0.000311951 0 0.00082206 0.000517879 0 0.00330137 -0.000693887 0 0.00281217 -0.00147083 0
-          0.00203986 -0.00166633 0 0.00161456 -0.00194692 0 0.00138593 -0.00231075 0 0.00125104 -0.00271384 0
-          0.00117015 -0.00313855 0 0.00108271 -0.00357825 0 0.000893963 -0.0040627 0 0.000760206 -0.00436543 0
+          -0.0829138 3.78983 0 -0.0416646 5.89248 0 -0.000255909 3.86918 0 -7.17453e-05 3.38582 0
+          -3.75017e-05 3.14999 0 -2.30714e-05 3.01001 0 -1.6838e-05 2.9188 0 -1.43726e-05 2.84115 0
+          -1.04324e-05 2.77467 0 -7.59694e-06 2.73669 0 -0.0819074 3.74188 0 -0.0416456 5.84396 0
+          -0.000855816 3.86811 0 -0.000243866 3.38485 0 -0.000127444 3.14908 0 -7.84008e-05 3.0092 0
+          -5.72491e-05 2.91801 0 -4.88648e-05 2.84032 0 -3.54326e-05 2.77388 0 -2.57781e-05 2.73598 0
+          -0.080499 3.64179 0 -0.0415921 5.74254 0 -0.00166838 3.86568 0 -0.000484743 3.38274 0
+          -0.00025327 3.14714 0 -0.000155795 3.00746 0 -0.000113837 2.91632 0 -9.71603e-05 2.83854 0
+          -7.03659e-05 2.77217 0 -5.11356e-05 2.73445 0 -0.0785288 3.50505 0 -0.0414656 5.60327 0
+          -0.00275341 3.86145 0 -0.000821669 3.37951 0 -0.00042922 3.14424 0 -0.000264008 3.00488 0
+          -0.000193078 2.91384 0 -0.000164784 2.83594 0 -0.000119139 2.76967 0 -8.64455e-05 2.73221 0
+          -0.0757747 3.31972 0 -0.0411909 5.41207 0 -0.00417185 3.85251 0 -0.00129217 3.37385 0
+          -0.00067503 3.13937 0 -0.000415181 3.0006 0 -0.000304024 2.90977 0 -0.000259457 2.83176 0
+          -0.000187147 2.76568 0 -0.000135494 2.7286 0 -0.0719333 3.07017 0 -0.0406258 5.14668 0
+          -0.00596586 3.82954 0 -0.00194565 3.36121 0 -0.00101749 3.12914 0 -0.000625882 2.99176 0
+          -0.000459188 2.90154 0 -0.000391885 2.82358 0 -0.000281732 2.75792 0 -0.000203337 2.72148 0
+          -0.0666109 2.73528 0 -0.0395153 4.76636 0 -0.00811156 3.76371 0 -0.00283764 3.32577 0
+          -0.00149025 3.10146 0 -0.000917371 2.96806 0 -0.000675112 2.8799 0 -0.000576363 2.80282 0
+          -0.000412435 2.73837 0 -0.000296318 2.7032 0 -0.0593847 2.29075 0 -0.0374488 4.19965 0
+          -0.0104161 3.58014 0 -0.00399146 3.21875 0 -0.00212252 3.01743 0 -0.00131031 2.89568 0
+          -0.000969656 2.81407 0 -0.000829088 2.74087 0 -0.000589452 2.68018 0 -0.000420611 2.648 0
+          -0.0500997 1.73413 0 -0.0339389 3.37521 0 -0.0123538 3.15371 0 -0.00527127 2.9363 0
+          -0.00288744 2.78692 0 -0.00179686 2.69282 0 -0.00134462 2.6278 0 -0.00115543 2.5658 0
+          -0.000814105 2.51488 0 -0.000574632 2.48949 0 -0.039512 1.169 0 -0.0288536 2.41486 0
+          -0.0130735 2.45905 0 -0.00621225 2.38908 0 -0.00359675 2.31796 0 -0.00227376 2.26668 0
+          -0.00173871 2.22818 0 -0.00151277 2.1857 0 -0.00105152 2.15195 0 -0.00072814 2.13797 0
+          -0.0289783 0.726512 0 -0.0230037 1.596 0 -0.0125724 1.72284 0 -0.00646723 1.68466 0
+          -0.00392497 1.65793 0 -0.00255786 1.65524 0 -0.00203107 1.6479 0 -0.00180159 1.62694 0
+          -0.00121873 1.61109 0 -0.000811768 1.60874 0 -0.0188751 0.418471 0 -0.0170299 1.00274 0
+          -0.0120214 1.16562 0 -0.00698249 1.13637 0 -0.00394586 1.09971 0 -0.00239288 1.07933 0
+          -0.00207455 1.06054 0 -0.00194954 1.04583 0 -0.00126745 1.04341 0 -0.000783911 1.05291 0
+          -0.00956399 0.209521 0 -0.0105904 0.564921 0 -0.0103522 0.754275 0 -0.00756226 0.796294 0
+          -0.00487263 0.775813 0 -0.00320872 0.731682 0 -0.00258759 0.694009 0 -0.00208613 0.675974 0
+          -0.00110107 0.668077 0 -0.00049598 0.66441 0 -0.00234196 0.0854938 0 -0.00435896 0.262628 0
+          -0.00663963 0.415506 0 -0.00648153 0.50605 0 -0.00544873 0.539677 0 -0.00429561 0.535521 0
+          -0.00337032 0.520874 0 -0.00255272 0.511011 0 -0.00153644 0.497043 0 -0.000954531 0.4775 0
+          0.00197236 0.0262012 0 0.000156101 0.0929362 0 -0.00242546 0.175071 0 -0.00351877 0.250071 0
+          -0.00391292 0.306129 0 -0.00382103 0.341233 0 -0.00338574 0.36053 0 -0.00286218 0.371328 0
+          -0.0021923 0.372795 0 -0.00176872 0.365832 0 0.00374287 0.00450661 0 0.00242792 0.0212855 0
+          0.000524042 0.0506913 0 -0.000506655 0.086759 0 -0.00129269 0.124101 0 -0.0018155 0.158541 0
+          -0.00199829 0.18738 0 -0.00199355 0.210089 0 -0.00178698 0.22705 0 -0.0015894 0.236565 0
+          0.0041142 -0.00091222 0 0.00310385 0.000706341 0 0.0017534 0.00737016 0 0.00116661 0.0175093 0
+          0.000668573 0.0310212 0 0.000217798 0.0471553 0 -9.56814e-05 0.0643679 0 -0.000330289 0.0809513 0
+          -0.000502446 0.096446 0 -0.000554069 0.107889 0 0.00403212 -0.00147707 0 0.00316799 -0.00244569 0
+          0.00202547 -0.00135445 0 0.00160669 0.000170088 0 0.00135634 0.00260926 0 0.00116421 0.00641401 0
+          0.00102156 0.0114605 0 0.000872794 0.0171835 0 0.000620044 0.0234692 0 0.000455597 0.028953 0
+          0.00387186 -0.00107736 0 0.00311919 -0.00205728 0 0.00208062 -0.00196136 0 0.00166246 -0.00199813 0
+          0.00144967 -0.00204088 0 0.00132506 -0.00193779 0 0.00125155 -0.00162874 0 0.00117197 -0.00115016 0
+          0.000969884 -0.000478993 0 0.000817945 0.000371963 0 0.00368888 -0.000869934 0 0.00301317 -0.00176544 0
+          0.00203583 -0.00190769 0 0.00159276 -0.00220384 0 0.00136691 -0.00258995 0 0.00123639 -0.00301398 0
+          0.00115951 -0.0034579 0 0.00107416 -0.00391495 0 0.000886622 -0.00441535 0 0.000753664 -0.00472994 0
         </DataArray>
         <DataArray type="Float32" Name="dv_y/dx_" NumberOfComponents="3" format="ascii">
-          -3.27874e-05 0.162818 0 -1.64502e-05 0.00166907 0 -6.44093e-08 0.000338775 0 -1.03472e-08 0.00014868 0
-          -3.99548e-09 8.95867e-05 0 -2.0656e-09 5.24524e-05 0 -6.41009e-10 3.98828e-05 0 -4.83109e-10 3.70653e-05 0
-          -1.14512e-09 2.82067e-05 0 -1.55759e-09 9.46009e-06 0 -0.000109921 0.16004 0 -5.53356e-05 0.00282147 0
-          -4.28276e-07 0.000582867 0 -6.99844e-08 0.000255761 0 -2.70253e-08 0.000154097 0 -1.3961e-08 9.01756e-05 0
-          -4.32353e-09 6.86398e-05 0 -3.2775e-09 6.37841e-05 0 -7.75174e-09 4.84814e-05 0 -1.05307e-08 1.62395e-05 0
-          -0.000213394 0.154287 0 -0.00010804 0.00516962 0 -1.5381e-06 0.00109954 0 -2.56625e-07 0.000482374 0
-          -9.91044e-08 0.000290604 0 -5.11504e-08 0.000169912 0 -1.57998e-08 0.000129562 0 -1.20617e-08 0.000120377 0
-          -2.84538e-08 9.13182e-05 0 -3.85959e-08 3.05253e-05 0 -0.000349741 0.146541 0 -0.000178518 0.00822219 0
-          -4.19744e-06 0.00182369 0 -7.20473e-07 0.000800106 0 -2.78286e-07 0.000481988 0 -1.4346e-07 0.000281468 0
-          -4.41566e-08 0.000215167 0 -3.40304e-08 0.000199872 0 -8.00043e-08 0.000151204 0 -1.08302e-07 5.03944e-05 0
-          -0.00052483 0.136282 0 -0.000270961 0.0120431 0 -9.89379e-06 0.0028351 0 -1.7671e-06 0.00124524 0
-          -6.82981e-07 0.000750235 0 -3.51533e-07 0.00043737 0 -1.0766e-07 0.000335563 0 -8.4071e-08 0.000311636 0
-          -1.96733e-07 0.000234836 0 -2.65576e-07 7.79341e-05 0 -0.000741366 0.123006 0 -0.000388843 0.0165368 0
-          -2.1216e-05 0.00422908 0 -4.00643e-06 0.00186575 0 -1.55156e-06 0.00112513 0 -7.97026e-07 0.000654393 0
-          -2.42327e-07 0.000504778 0 -1.92786e-07 0.000468731 0 -4.48342e-07 0.000351282 0 -6.02889e-07 0.00011584 0
-          -0.000994685 0.106433 0 -0.000533046 0.0212778 0 -4.22661e-05 0.0060713 0 -8.61609e-06 0.00271361 0
-          -3.35588e-06 0.00164223 0 -1.72036e-06 0.000952184 0 -5.17332e-07 0.000740742 0 -4.22766e-07 0.000688193 0
-          -9.754e-07 0.000511785 0 -1.3046e-06 0.000167097 0 -0.00126748 0.0869134 0 -0.000698877 0.0253604 0
-          -7.85638e-05 0.00823956 0 -1.76885e-05 0.00379945 0 -6.99289e-06 0.0023233 0 -3.58187e-06 0.0013415 0
-          -1.05784e-06 0.00105901 0 -9.00072e-07 0.000986413 0 -2.05809e-06 0.000725628 0 -2.73248e-06 0.000232912 0
-          -0.0015271 0.0659704 0 -0.000873296 0.0275988 0 -0.000135513 0.0101579 0 -3.42029e-05 0.00497792 0
-          -1.39861e-05 0.00311627 0 -7.18819e-06 0.00178619 0 -2.05302e-06 0.00144868 0 -1.86457e-06 0.00135934 0
-          -4.23416e-06 0.000984344 0 -5.56642e-06 0.000305798 0 -0.00173214 0.0458985 0 -0.00103681 0.0273492 0
-          -0.000215528 0.011241 0 -6.03237e-05 0.00585149 0 -2.63181e-05 0.00384007 0 -1.36787e-05 0.00216925 0
-          -3.6423e-06 0.00184735 0 -3.71151e-06 0.00175566 0 -8.437e-06 0.00123891 0 -1.09493e-05 0.00035911 0
-          -0.00184157 0.0283823 0 -0.00116708 0.0245941 0 -0.000317742 0.0118961 0 -9.69382e-05 0.00652606 0
-          -4.51991e-05 0.00420425 0 -2.40798e-05 0.00227251 0 -5.55887e-06 0.00214497 0 -7.02212e-06 0.00209545 0
-          -1.60722e-05 0.0014184 0 -2.04819e-05 0.000352647 0 -0.00182206 0.0143182 0 -0.00123246 0.0193267 0
-          -0.000429946 0.0121832 0 -0.000151605 0.00744944 0 -7.67963e-05 0.00458159 0 -3.81169e-05 0.00253359 0
-          -5.74348e-06 0.00246343 0 -1.23339e-05 0.00236763 0 -2.91194e-05 0.00142169 0 -3.62446e-05 0.000209287 0
-          -0.00167514 0.0043663 0 -0.00120255 0.0122786 0 -0.000515073 0.0106764 0 -0.000223233 0.00788059 0
-          -0.000126872 0.00536096 0 -5.92713e-05 0.00352286 0 -8.31612e-06 0.00304406 0 -2.43299e-05 0.00267903 0
-          -5.19314e-05 0.00151853 0 -6.07681e-05 0.000200167 0 -0.00145397 -0.0014464 0 -0.00108568 0.00543501 0
-          -0.000532245 0.00693929 0 -0.000275241 0.00650686 0 -0.000178157 0.00543045 0 -9.20078e-05 0.00436725 0
-          -2.53708e-05 0.00359811 0 -4.78176e-05 0.00300331 0 -8.67777e-05 0.00205229 0 -9.75747e-05 0.000691484 0
-          -0.00122697 -0.00404188 0 -0.000929476 0.000646691 0 -0.000480169 0.0026838 0 -0.000272367 0.00356189 0
-          -0.000196546 0.00378982 0 -0.000118939 0.00374994 0 -5.27313e-05 0.00331325 0 -7.46677e-05 0.00286475 0
-          -0.000127214 0.00243891 0 -0.000149395 0.00125974 0 -0.00102648 -0.00476945 0 -0.000779063 -0.00172334 0
-          -0.000399342 -0.000273207 0 -0.000224818 0.000675323 0 -0.000169584 0.00131231 0 -0.000113734 0.0018471 0
-          -6.57261e-05 0.00190759 0 -8.76784e-05 0.00183403 0 -0.000159949 0.00186803 0 -0.00020509 0.00121969 0
-          -0.000838137 -0.0047061 0 -0.000642503 -0.00251121 0 -0.000327074 -0.00156141 0 -0.000171171 -0.00097632 0
-          -0.000121758 -0.000509798 0 -8.09456e-05 -1.32636e-05 0 -5.35654e-05 0.00020317 0 -7.71928e-05 0.000339326 0
-          -0.000166424 0.000571088 0 -0.000232155 0.000579402 0 -0.000634227 -0.00442866 0 -0.000498069 -0.00269104 0
-          -0.000262191 -0.00190527 0 -0.000130851 -0.0015297 0 -8.35295e-05 -0.00126159 0 -5.00269e-05 -0.000998636 0
-          -3.42204e-05 -0.000863059 0 -5.4803e-05 -0.000737668 0 -0.000138497 -0.000525705 0 -0.000203604 -0.000128051 0
-          -0.000403394 -0.00413499 0 -0.000326833 -0.0027258 0 -0.000181793 -0.00195672 0 -9.06477e-05 -0.00161397 0
-          -5.53232e-05 -0.00140306 0 -3.10908e-05 -0.00125461 0 -2.09189e-05 -0.0011833 0 -3.49906e-05 -0.00110337 0
-          -9.01622e-05 -0.000945251 0 -0.000132664 -0.000494514 0 -0.000140625 -0.0040148 0 -0.000116574 -0.00272877 0
-          -6.74697e-05 -0.00195672 0 -3.38848e-05 -0.00160975 0 -2.05922e-05 -0.00140111 0 -1.15392e-05 -0.00126979 0
-          -7.73333e-06 -0.00120974 0 -1.31124e-05 -0.00114072 0 -3.1864e-05 -0.000995586 0 -4.57232e-05 -0.000570085 0
+          -3.62829e-05 0.18012 0 -1.81976e-05 0.00164376 0 -6.36849e-08 0.000322273 0 -9.85233e-09 0.000141119 0
+          -3.81383e-09 8.49367e-05 0 -1.94456e-09 4.92583e-05 0 -5.42885e-10 3.81483e-05 0 -4.40682e-10 3.62338e-05 0
+          -1.13135e-09 2.74897e-05 0 -1.53974e-09 8.95928e-06 0 -0.000121711 0.177086 0 -6.12278e-05 0.00277758 0
+          -4.23305e-07 0.000554592 0 -6.6653e-08 0.000242767 0 -2.57984e-08 0.000146102 0 -1.31422e-08 8.4684e-05 0
+          -3.65999e-09 6.56619e-05 0 -2.99154e-09 6.23565e-05 0 -7.65883e-09 4.72474e-05 0 -1.04094e-08 1.53792e-05 0
+          -0.000236522 0.170812 0 -0.000119594 0.00508606 0 -1.51963e-06 0.00104656 0 -2.44481e-07 0.000457912 0
+          -9.46138e-08 0.000275538 0 -4.81476e-08 0.000159564 0 -1.33674e-08 0.000123964 0 -1.10176e-08 0.000117693 0
+          -2.81142e-08 8.89887e-05 0 -3.81487e-08 2.89065e-05 0 -0.000388243 0.162392 0 -0.000197742 0.00808265 0
+          -4.14495e-06 0.00173668 0 -6.86658e-07 0.000759638 0 -2.6571e-07 0.000457029 0 -1.35028e-07 0.000264324 0
+          -3.73297e-08 0.000205925 0 -3.11162e-08 0.000195441 0 -7.90551e-08 0.000147335 0 -1.07037e-07 4.77177e-05 0
+          -0.000583961 0.151278 0 -0.000300458 0.0118262 0 -9.76377e-06 0.00270164 0 -1.68509e-06 0.0011825 0
+          -6.52232e-07 0.000711452 0 -3.30837e-07 0.000410726 0 -9.09148e-08 0.000321269 0 -7.69776e-08 0.000304784 0
+          -1.94419e-07 0.000228801 0 -2.62444e-07 7.37844e-05 0 -0.000827823 0.136952 0 -0.000431913 0.0162178 0
+          -2.09204e-05 0.00403372 0 -3.8234e-06 0.0017723 0 -1.4821e-06 0.00106712 0 -7.49996e-07 0.000614515 0
+          -2.04305e-07 0.000483533 0 -1.76854e-07 0.00045855 0 -4.43134e-07 0.000342199 0 -5.95682e-07 0.000109645 0
+          -0.00111677 0.119131 0 -0.000593748 0.0208372 0 -4.16385e-05 0.00579823 0 -8.23102e-06 0.00257901 0
+          -3.20693e-06 0.00155792 0 -1.61854e-06 0.000894101 0 -4.35058e-07 0.000710113 0 -3.88838e-07 0.000673521 0
+          -9.64292e-07 0.000498428 0 -1.28872e-06 0.000158077 0 -0.00143511 0.0981653 0 -0.000782016 0.0248015 0
+          -7.7323e-05 0.00788239 0 -1.69224e-05 0.00361408 0 -6.68705e-06 0.0022049 0 -3.369e-06 0.00125942 0
+          -8.85712e-07 0.00101638 0 -8.30781e-07 0.00096601 0 -2.03542e-06 0.000706408 0 -2.69848e-06 0.000220064 0
+          -0.00175134 0.0755874 0 -0.000984206 0.0269685 0 -0.00013327 0.00973538 0 -3.27852e-05 0.00474116 0
+          -1.33904e-05 0.0029593 0 -6.75867e-06 0.00167582 0 -1.70399e-06 0.00139282 0 -1.72942e-06 0.00133263 0
+          -4.19037e-06 0.000957581 0 -5.49543e-06 0.000288013 0 -0.00202386 0.0537501 0 -0.00118073 0.0267321 0
+          -0.000211904 0.0107781 0 -5.79499e-05 0.00558069 0 -2.5247e-05 0.00364932 0 -1.28537e-05 0.00203187 0
+          -2.9636e-06 0.00178106 0 -3.46602e-06 0.00172399 0 -8.36033e-06 0.00120351 0 -1.08066e-05 0.000335532 0
+          -0.00220939 0.0344066 0 -0.00134846 0.024113 0 -0.000312564 0.0114156 0 -9.32135e-05 0.00623394 0
+          -4.34725e-05 0.00399258 0 -2.25953e-05 0.002116 0 -4.31382e-06 0.00207813 0 -6.6251e-06 0.00206403 0
+          -1.59598e-05 0.00137456 0 -2.02105e-05 0.000322919 0 -0.00226818 0.0184836 0 -0.00145358 0.0191089 0
+          -0.000424081 0.011769 0 -0.000146041 0.00715372 0 -7.41158e-05 0.00436838 0 -3.5573e-05 0.0023723 0
+          -3.58041e-06 0.00239356 0 -1.18155e-05 0.00233152 0 -2.90226e-05 0.00136928 0 -3.5767e-05 0.000172387 0
+          -0.00218861 0.00674209 0 -0.00146002 0.012347 0 -0.000511189 0.0104495 0 -0.000216169 0.00765336 0
+          -0.000122912 0.00518127 0 -5.54053e-05 0.00337828 0 -4.99129e-06 0.00296013 0 -2.36428e-05 0.00262543 0
+          -5.18322e-05 0.00145986 0 -5.99814e-05 0.000159696 0 -0.00200744 -0.000581031 0 -0.00136734 0.00567247 0
+          -0.000533254 0.00692277 0 -0.00026858 0.00641932 0 -0.000173554 0.00533249 0 -8.72365e-05 0.00427409 0
+          -2.10915e-05 0.0035205 0 -4.67117e-05 0.0029425 0 -8.63754e-05 0.00199788 0 -9.62503e-05 0.000657657 0
+          -0.00178133 -0.00421703 0 -0.00121567 0.00089271 0 -0.000486869 0.00277828 0 -0.000267955 0.00359381 0
+          -0.000192769 0.003788 0 -0.000114411 0.00373305 0 -4.83529e-05 0.00328043 0 -7.32253e-05 0.00282839 0
+          -0.000126236 0.00240686 0 -0.000147267 0.00124228 0 -0.00154154 -0.00548662 0 -0.00104843 -0.00156093 0
+          -0.000410113 -0.000177706 0 -0.000222547 0.000743225 0 -0.000167206 0.00136033 0 -0.000110376 0.00188345 0
+          -6.23344e-05 0.00192246 0 -8.65371e-05 0.00183567 0 -0.000158685 0.00186836 0 -0.000202436 0.0012211 0
+          -0.00128022 -0.00558767 0 -0.000876827 -0.00243809 0 -0.000339806 -0.00150466 0 -0.000169789 -0.000928368 0
+          -0.000119994 -0.000466737 0 -7.85325e-05 2.7023e-05 0 -5.14025e-05 0.000231111 0 -7.6678e-05 0.000358257 0
+          -0.000165461 0.000589229 0 -0.000229891 0.000590812 0 -0.000978674 -0.00528333 0 -0.00068359 -0.00268037 0
+          -0.000275211 -0.00187485 0 -0.000129803 -0.00150345 0 -8.18368e-05 -0.00123739 0 -4.80199e-05 -0.000976176 0
+          -3.27369e-05 -0.000846285 0 -5.45374e-05 -0.000724106 0 -0.000137905 -0.000511087 0 -0.000202153 -0.000118654 0
+          -0.00062897 -0.00491785 0 -0.000450434 -0.00275424 0 -0.000192576 -0.00193425 0 -9.00453e-05 -0.00159329 0
+          -5.40336e-05 -0.00138555 0 -2.96061e-05 -0.00124083 0 -1.98691e-05 -0.00117407 0 -3.47457e-05 -0.0010958 0
+          -8.97205e-05 -0.000936978 0 -0.000131706 -0.000489231 0 -0.000220822 -0.00476766 0 -0.000161053 -0.00277012 0
+          -7.1885e-05 -0.00193511 0 -3.3707e-05 -0.00158877 0 -2.01092e-05 -0.00138366 0 -1.09814e-05 -0.00125671 0
+          -7.33561e-06 -0.00120135 0 -1.3014e-05 -0.00113402 0 -3.16736e-05 -0.000988636 0 -4.53188e-05 -0.000565844 0
         </DataArray>
         <DataArray type="Float32" Name="velocity_gas (m/s)" NumberOfComponents="3" format="ascii">
-          0.0504679 1.97571e-05 0 0.000723727 8.47016e-08 0 0.000469284 1.68822e-08 0 0.00040841 7.41047e-09 0
-          0.000378647 4.46554e-09 0 0.0003609 2.61589e-09 0 0.000349364 1.98683e-09 0 0.000339757 1.84669e-09 0
-          0.000331602 1.40711e-09 0 0.000326892 4.72541e-10 0 0.0515739 6.65169e-05 0 0.00244333 5.64042e-07 0
-          0.00159507 1.14175e-07 0 0.00138817 5.011e-08 0 0.00128701 3.0194e-08 0 0.00122671 1.76797e-08 0
-          0.0011875 1.34408e-08 0 0.00115483 1.24916e-08 0 0.00112712 9.50785e-09 0 0.00111113 3.1894e-09 0
-          0.0530896 0.000130066 0 0.00481764 2.02942e-06 0 0.00317036 4.18628e-07 0 0.00275914 1.83695e-07 0
-          0.00255809 1.10678e-07 0 0.00243828 6.47701e-08 0 0.00236035 4.92975e-08 0 0.00229535 4.58107e-08 0
-          0.00224028 3.48235e-08 0 0.00220857 1.16658e-08 0 0.0551485 0.000215397 0 0.00807755 5.55251e-06 0
-          0.00537401 1.17518e-06 0 0.00467712 5.15582e-07 0 0.00433633 3.10615e-07 0 0.00413334 1.81638e-07 0
-          0.00400124 1.38463e-07 0 0.00389094 1.28651e-07 0 0.00379761 9.76269e-08 0 0.003744 3.26453e-08 0
-          0.0579098 0.000328035 0 0.0125176 1.31371e-05 0 0.00845471 2.88233e-06 0 0.00735924 1.26459e-06 0
-          0.00682317 7.61816e-07 0 0.00650402 4.45018e-07 0 0.00629619 3.39978e-07 0 0.00612238 3.15828e-07 0
-          0.0059756 2.39093e-07 0 0.00589154 7.97462e-08 0 0.0615451 0.000473149 0 0.0184938 2.83299e-05 0
-          0.0127541 6.53727e-06 0 0.0111063 2.87072e-06 0 0.0102981 1.72955e-06 0 0.00981718 1.00885e-06 0
-          0.00950366 7.73124e-07 0 0.00924085 7.18059e-07 0 0.00901949 5.41782e-07 0 0.00889331 1.80045e-07 0
-          0.0661967 0.000653735 0 0.0263872 5.69241e-05 0 0.0187226 1.40803e-05 0 0.0163258 6.20481e-06 0
-          0.0151421 3.74099e-06 0 0.0144377 2.17776e-06 0 0.0139777 1.67656e-06 0 0.0135906 1.55697e-06 0
-          0.0132657 1.16924e-06 0 0.0130817 3.86476e-07 0 0.0718784 0.000867696 0 0.0364654 0.000107207 0
-          0.0268737 2.90435e-05 0 0.0235246 1.29301e-05 0 0.0218404 7.8173e-06 0 0.0208356 4.53859e-06 0
-          0.0201772 3.51906e-06 0 0.0196194 3.2692e-06 0 0.0191532 2.43898e-06 0 0.018892 7.99474e-07 0
-          0.078285 0.0011048 0 0.0485075 0.000188539 0 0.0375005 5.68418e-05 0 0.0331425 2.59231e-05 0
-          0.0308591 1.57984e-05 0 0.0294851 9.13986e-06 0 0.0285782 7.17261e-06 0 0.0277996 6.67627e-06 0
-          0.0271519 4.93512e-06 0 0.0267945 1.59525e-06 0 0.0846178 0.00134702 0 0.0612387 0.000307731 0
-          0.0499715 0.000102848 0 0.0449751 4.90982e-05 0 0.0421502 3.04592e-05 0 0.0404198 1.75165e-05 0
-          0.039263 1.40448e-05 0 0.0382424 1.31458e-05 0 0.0373971 9.59098e-06 0 0.0369431 3.02133e-06 0
-          0.0902102 0.00157168 0 0.0731756 0.000466735 0 0.0626333 0.000171185 0 0.0575259 8.54444e-05 0
-          0.0544824 5.48596e-05 0 0.0525518 3.12055e-05 0 0.0512319 2.59639e-05 0 0.0500124 2.45349e-05 0
-          0.0490126 1.75374e-05 0 0.0485037 5.24813e-06 0 0.0948666 0.0017512 0 0.0838923 0.00065797 0
-          0.0745482 0.000272257 0 0.0689939 0.000142034 0 0.065767 9.0331e-05 0 0.0639783 4.98788e-05 0
-          0.0627091 4.45909e-05 0 0.0613922 4.29868e-05 0 0.0603165 2.97902e-05 0 0.05982 8.04332e-06 0
-          0.0982877 0.00185714 0 0.0928284 0.000852052 0 0.0857915 0.000414083 0 0.0801712 0.000233964 0
-          0.0764049 0.000146203 0 0.0740718 8.17178e-05 0 0.072374 7.50775e-05 0 0.0708525 7.17386e-05 0
-          0.0697938 4.58817e-05 0 0.0694643 9.4207e-06 0 0.100315 0.00187308 0 0.0990329 0.00100069 0
-          0.0952852 0.000570255 0 0.0911052 0.000361997 0 0.0873979 0.000239966 0 0.0844219 0.000148208 0
-          0.0821052 0.000129556 0 0.0802618 0.000117764 0 0.0789501 7.21752e-05 0 0.0783474 1.36303e-05 0
-          0.101218 0.00180062 0 0.102339 0.00106443 0 0.101466 0.000685247 0 0.0996017 0.000488231 0
-          0.0973055 0.000358407 0 0.0949087 0.000252375 0 0.0926883 0.00021568 0 0.0907941 0.000189098 0
-          0.0891967 0.000126078 0 0.0881158 3.64415e-05 0 0.101455 0.00165195 0 0.103501 0.00103607 0
-          0.104256 0.000717079 0 0.104277 0.000556858 0 0.103754 0.000447297 0 0.102805 0.000353358 0
-          0.101629 0.000310815 0 0.100433 0.000274487 0 0.0992422 0.000205601 0 0.0982875 8.25472e-05 0
-          0.101433 0.00143533 0 0.103644 0.000932443 0 0.10494 0.000664322 0 0.105821 0.000539954 0
-          0.106403 0.000458917 0 0.106683 0.000393845 0 0.106721 0.000361782 0 0.106615 0.000329567 0
-          0.106361 0.000269151 0 0.106041 0.000129858 0 0.101348 0.00114734 0 0.103508 0.000766801 0
-          0.104903 0.000549654 0 0.105966 0.000452171 0 0.106859 0.000392633 0 0.10762 0.000351936 0
-          0.10828 0.000332601 0 0.108865 0.000310871 0 0.109346 0.000266837 0 0.109627 0.000144674 0
-          0.101253 0.000770508 0 0.103329 0.000528472 0 0.104746 0.000378309 0 0.105835 0.000310321 0
-          0.106763 0.000269532 0 0.107592 0.000243933 0 0.108366 0.000232223 0 0.109102 0.00021883 0
-          0.109778 0.000190234 0 0.110271 0.000110636 0 0.101167 0.000278312 0 0.103148 0.000193937 0
-          0.104542 0.000138423 0 0.105596 0.000112973 0 0.10648 9.77615e-05 0 0.107259 8.82625e-05 0
-          0.107981 8.39144e-05 0 0.108663 7.89825e-05 0 0.10928 6.81795e-05 0 0.109736 4.07456e-05 0
+          0.0504607 2.18532e-05 0 0.000712422 8.34551e-08 0 0.00046319 1.60565e-08 0 0.000405331 7.03323e-09 0
+          0.000377096 4.23368e-09 0 0.000360329 2.45663e-09 0 0.00034941 1.90021e-09 0 0.000340124 1.80516e-09 0
+          0.000332163 1.37138e-09 0 0.000327605 4.47539e-10 0 0.0515491 7.3582e-05 0 0.00240469 5.55527e-07 0
+          0.00157438 1.0861e-07 0 0.00137771 4.75612e-08 0 0.00128174 2.86267e-08 0 0.00122477 1.66032e-08 0
+          0.00118766 1.2856e-08 0 0.00115608 1.22111e-08 0 0.00112902 9.26614e-09 0 0.00111356 3.02053e-09 0
+          0.0530398 0.000143911 0 0.00474041 1.99792e-06 0 0.00312931 3.98313e-07 0 0.00273836 1.74362e-07 0
+          0.00254762 1.04935e-07 0 0.00243444 6.08257e-08 0 0.00236067 4.71582e-08 0 0.00229783 4.47848e-08 0
+          0.00224408 3.39369e-08 0 0.00221339 1.10477e-08 0 0.0550633 0.000238409 0 0.007946 5.46337e-06 0
+          0.00530461 1.1185e-06 0 0.00464191 4.89428e-07 0 0.0043186 2.9451e-07 0 0.00412685 1.70576e-07 0
+          0.00400179 1.32476e-07 0 0.00389515 1.2578e-07 0 0.00380405 9.51364e-08 0 0.00375219 3.09138e-08 0
+          0.057775 0.000363294 0 0.0123101 1.29171e-05 0 0.00834592 2.74447e-06 0 0.00730389 1.20059e-06 0
+          0.00679531 7.22356e-07 0 0.00649386 4.17913e-07 0 0.0062971 3.25352e-07 0 0.00612903 3.08814e-07 0
+          0.00598575 2.32977e-07 0 0.00590445 7.55109e-08 0 0.0613419 0.000524524 0 0.018182 2.78304e-05 0
+          0.0125909 6.22818e-06 0 0.0110229 2.72591e-06 0 0.0102562 1.64009e-06 0 0.00980194 9.47393e-07 0
+          0.0095051 7.401e-07 0 0.00925092 7.02225e-07 0 0.00903484 5.27872e-07 0 0.00891284 1.70462e-07 0
+          0.0659043 0.000725923 0 0.0259377 5.58595e-05 0 0.018486 1.34251e-05 0 0.0162039 5.89337e-06 0
+          0.0150808 3.54792e-06 0 0.0144156 2.04506e-06 0 0.0139799 1.60568e-06 0 0.0136054 1.52298e-06 0
+          0.0132883 1.13906e-06 0 0.0131105 3.6583e-07 0 0.0714816 0.000966141 0 0.0358508 0.000105074 0
+          0.026543 2.77222e-05 0 0.0233515 1.22863e-05 0 0.0217532 7.41529e-06 0 0.0208045 4.26182e-06 0
+          0.0201809 3.37248e-06 0 0.0196409 3.19896e-06 0 0.019186 2.37553e-06 0 0.0189336 7.56445e-07 0
+          0.0777928 0.00123538 0 0.047733 0.000184574 0 0.0370661 5.43331e-05 0 0.0329085 2.46497e-05 0
+          0.0307406 1.49909e-05 0 0.0294435 8.58116e-06 0 0.0285844 6.88048e-06 0 0.02783 6.53635e-06 0
+          0.0271978 4.80515e-06 0 0.0268531 1.5079e-06 0 0.0840812 0.00151534 0 0.060374 0.000301019 0
+          0.0494569 9.84565e-05 0 0.0446858 4.67342e-05 0 0.0420022 2.89167e-05 0 0.0403697 1.64378e-05 0
+          0.0392737 1.34922e-05 0 0.0382833 1.28814e-05 0 0.0374584 9.33296e-06 0 0.0370215 2.84902e-06 0
+          0.0896839 0.00178212 0 0.072297 0.000456493 0 0.0620795 0.000163968 0 0.0572101 8.14164e-05 0
+          0.0543188 5.21117e-05 0 0.0525002 2.92493e-05 0 0.0512494 2.49972e-05 0 0.0500629 2.40726e-05 0
+          0.0490875 1.70471e-05 0 0.0486004 4.92083e-06 0 0.0944273 0.00200531 0 0.0831023 0.000644407 0
+          0.0739914 0.000261023 0 0.0686766 0.00013551 0 0.0656125 8.57741e-05 0 0.0639416 4.65713e-05 0
+          0.062741 4.30864e-05 0 0.0614521 4.22746e-05 0 0.0604015 2.89077e-05 0 0.0599312 7.44757e-06 0
+          0.098027 0.00215063 0 0.0922886 0.000837467 0 0.0853185 0.000398607 0 0.0798659 0.00022404 0
+          0.0762438 0.000139204 0 0.0740188 7.65461e-05 0 0.0723934 7.27181e-05 0 0.0709137 7.05566e-05 0
+          0.06989 4.43468e-05 0 0.0695924 8.35781e-06 0 0.100275 0.0021935 0 0.0988703 0.000989035 0
+          0.0950447 0.000552689 0 0.0909027 0.00034913 0 0.0872669 0.000230393 0 0.0843642 0.000140866 0
+          0.0821121 0.00012571 0 0.0803198 0.000115556 0 0.0790488 6.9656e-05 0 0.0784761 1.19052e-05 0
+          0.101368 0.00212793 0 0.102551 0.00105913 0 0.101555 0.000669126 0 0.0996407 0.000474886 0
+          0.0973326 0.00034758 0 0.0949452 0.000243563 0 0.0927474 0.000210288 0 0.0908823 0.000185541 0
+          0.0893128 0.000122418 0 0.0882515 3.40571e-05 0 0.101709 0.0019628 0 0.103955 0.00103787 0
+          0.104622 0.000704681 0 0.104583 0.000545738 0 0.104014 0.000437624 0 0.103032 0.000345091 0
+          0.101836 0.000305173 0 0.100634 0.00027029 0 0.0994435 0.000201329 0 0.0984899 7.98674e-05 0
+          0.101713 0.00170771 0 0.104182 0.000939577 0 0.105438 0.000655515 0 0.106286 0.00053181 0
+          0.106838 0.000451768 0 0.107088 0.000387817 0 0.107099 0.000357529 0 0.106973 0.000326135 0
+          0.106703 0.000265516 0 0.10637 0.000127581 0 0.101611 0.00136365 0 0.10403 0.000776445 0
+          0.105413 0.000543342 0 0.106461 0.000446192 0 0.107341 0.000387578 0 0.108088 0.000347988 0
+          0.108738 0.000329954 0 0.109314 0.000308704 0 0.109785 0.00026451 0 0.110058 0.000143218 0
+          0.101491 0.00091459 0 0.103814 0.000537208 0 0.105234 0.000374069 0 0.106311 0.000306117 0
+          0.107229 0.000266015 0 0.108051 0.000241277 0 0.108819 0.000230488 0 0.109553 0.000217434 0
+          0.110226 0.000188793 0 0.110716 0.000109769 0 0.101385 0.000330096 0 0.103598 0.000197603 0
+          0.105 0.000136833 0 0.106041 0.000111341 0 0.106912 9.63849e-05 0 0.107681 8.72102e-05 0
+          0.108395 8.32073e-05 0 0.109073 7.84075e-05 0 0.109684 6.75905e-05 0 0.110137 4.03992e-05 0
         </DataArray>
         <DataArray type="Float32" Name="process rank" NumberOfComponents="1" format="ascii">
           0 0 0 0 0 0 0 0 0 0 0 0
diff --git a/tutorial/ex1/injection2p2cproblem.hh b/tutorial/ex1/injection2p2cproblem.hh
index c0abe7fff8a5a80ab6129ca2b6e394d10fbd108b..a9331eb5e4ffedbdda739b2f80ca32b842484675 100644
--- a/tutorial/ex1/injection2p2cproblem.hh
+++ b/tutorial/ex1/injection2p2cproblem.hh
@@ -82,7 +82,7 @@ class Injection2p2cProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
@@ -200,8 +200,8 @@ public:
 
             // inject nitrogen. negative values mean injection
             // convert from units kg/(s*m^2) to mole/(s*m^2)
-            values[Indices::contiNEqIdx] = -1e-4/FluidSystem::molarMass(FluidSystem::nCompIdx);
-            values[Indices::contiWEqIdx] = 0.0;
+            values[Indices::conti0EqIdx + FluidSystem::N2Idx] = -1e-4/FluidSystem::molarMass(FluidSystem::N2Idx);
+            values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
         }
 
         return values;
@@ -226,7 +226,7 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values.setState(Indices::wPhaseOnly);
+        values.setState(Indices::firstPhaseOnly);
         // get the water density at atmospheric conditions
         const Scalar densityW = FluidSystem::H2O::liquidDensity(temperature(), 1.0e5);
 
diff --git a/tutorial/ex1/injection2pniproblem.hh b/tutorial/ex1/injection2pniproblem.hh
index 6e55b7b56f79b7cc159f59f702d99366ef054cd9..85253bbdc2bed4a825e5562a1050ce3c19fb9564 100644
--- a/tutorial/ex1/injection2pniproblem.hh
+++ b/tutorial/ex1/injection2pniproblem.hh
@@ -84,7 +84,7 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
diff --git a/tutorial/ex1/injection2pproblem.hh b/tutorial/ex1/injection2pproblem.hh
index 999cc87e56e843adf2370dadf8bd7dd3ae5bf79c..5e0b2980d6095617d5d85e2c267c19d4fb75dc18 100644
--- a/tutorial/ex1/injection2pproblem.hh
+++ b/tutorial/ex1/injection2pproblem.hh
@@ -81,7 +81,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
@@ -196,8 +196,8 @@ public:
         {
             // inject nitrogen. negative values mean injection
             // units kg/(s*m^2)
-            values[Indices::contiNEqIdx] = -1e-4;
-            values[Indices::contiWEqIdx] = 0.0;
+            values[Indices::conti0EqIdx + FluidSystem::N2Idx] = -1e-4;
+            values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
         }
 
         return values;
diff --git a/tutorial/ex1/injection2pspatialparams.hh b/tutorial/ex1/injection2pspatialparams.hh
index 8449b258539d80b5506ff5295ffd88ef1115d27b..411f22bd73a8d6537554a16518e4ca75591aae0d 100644
--- a/tutorial/ex1/injection2pspatialparams.hh
+++ b/tutorial/ex1/injection2pspatialparams.hh
@@ -153,6 +153,16 @@ public:
         return aquiferMaterialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
     /*!
      *  These parameters are only needed for nonisothermal models. Comment them in if you want to implement the 2pni model.
      */
diff --git a/tutorial/ex2/injection2p2cproblem.hh b/tutorial/ex2/injection2p2cproblem.hh
index 9455d68c43574123341b57fb6e737beaffde6375..159466e91bb015a30185a1e1e90c3048aa568fc3 100644
--- a/tutorial/ex2/injection2p2cproblem.hh
+++ b/tutorial/ex2/injection2p2cproblem.hh
@@ -96,7 +96,7 @@ class Injection2p2cProblem : public PorousMediumFlowProblem<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
@@ -207,8 +207,8 @@ public:
         {
             // set the Neumann values for the Nitrogen component balance
             // convert from units kg/(s*m^2) to mole/(s*m^2)
-            values[Indices::contiNEqIdx] = -totalAreaSpecificInflow_/FluidSystem::molarMass(FluidSystem::nCompIdx);
-            values[Indices::contiWEqIdx] = 0.0;
+            values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = -totalAreaSpecificInflow_/FluidSystem::molarMass(FluidSystem::N2Idx);
+            values[Indices::conti0EqIdx + FluidSystem::N2Idx] = 0.0;
         }
 
         return values;
@@ -232,7 +232,7 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values.setState(Indices::wPhaseOnly);
+        values.setState(Indices::firstPhaseOnly);
 
         // get the water density at atmospheric conditions
         const Scalar densityW = FluidSystem::H2O::liquidDensity(temperature(), 1.0e5);
diff --git a/tutorial/ex2/injection2p2cspatialparams.hh b/tutorial/ex2/injection2p2cspatialparams.hh
index 1467c696beb4e974421e302c40a32a55b4ceed5a..0c0eb3137599faf72b90e44e871f05a7b2865a3c 100644
--- a/tutorial/ex2/injection2p2cspatialparams.hh
+++ b/tutorial/ex2/injection2p2cspatialparams.hh
@@ -162,13 +162,23 @@ public:
      *
      * \return the material parameters object
      */
-     const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
+    const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
     {
         if (isInAquitard_(globalPos))
             return aquitardMaterialParams_;
         return aquiferMaterialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
     /*!
      * \brief Creates a gnuplot output of the pc-Sw curve
      */
diff --git a/tutorial/ex2/mylocalresidual.hh b/tutorial/ex2/mylocalresidual.hh
index bebb514dc0058dcf9f0708458097782f15970b6c..5c79e24b00230a1fb8beee824436fce0e72c39ab 100644
--- a/tutorial/ex2/mylocalresidual.hh
+++ b/tutorial/ex2/mylocalresidual.hh
@@ -49,7 +49,7 @@ class MyCompositionalLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResid
     using ResidualVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
diff --git a/tutorial/ex3/2p2cproblem.hh b/tutorial/ex3/2p2cproblem.hh
index 0dc70f7ab9854b03091b4baaa6b8a88bbbb6f793..a6225799182aacdb44a00457a44cd57cfefa2dae 100644
--- a/tutorial/ex3/2p2cproblem.hh
+++ b/tutorial/ex3/2p2cproblem.hh
@@ -91,7 +91,7 @@ class ExerciseThreeProblemTwoPTwoC : public PorousMediumFlowProblem<TypeTag>
     using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
 
     // Dumux specific types
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
@@ -107,11 +107,11 @@ public:
       std::cout << "If you want to use simplices instead of cubes, install and use dune-ALUGrid or UGGrid." << std::endl;
 #endif // !(HAVE_DUNE_ALUGRID || HAVE_UG)
 
-      // initialize the fluid system
-      FluidSystem::init();
+        // initialize the fluid system
+        FluidSystem::init();
 
-      // set the depth of the bottom of the reservoir
-      depthBOR_ = this->fvGridGeometry().bBoxMax()[dimWorld-1];
+        // set the depth of the bottom of the reservoir
+        depthBOR_ = this->fvGridGeometry().bBoxMax()[dimWorld-1];
 
         // name of the problem and output file
         name_ = getParam<std::string>("Problem.Name");
@@ -170,7 +170,7 @@ public:
     PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables priVars;
-        priVars.setState(Indices::wPhaseOnly);
+        priVars.setState(Indices::firstPhaseOnly);
         priVars[Indices::pressureIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]);
         priVars[Indices::switchIdx] = 0.0; // 0 % oil saturation on left boundary
        return priVars;
@@ -196,12 +196,12 @@ public:
         if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40) {
             // oil outflux of 30 g/(m * s) on the right boundary.
             // we solve for the mole balance, so we have to divide by the molar mass
-            values[Indices::contiWEqIdx] = 0;
-            values[Indices::contiNEqIdx] = -3e-2/FluidSystem::MyCompressibleComponent::molarMass();
+            values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0;
+            values[Indices::conti0EqIdx + FluidSystem::NAPLIdx] = -3e-2/FluidSystem::MyCompressibleComponent::molarMass();
         } else {
             // no-flow on the remaining Neumann-boundaries.
-            values[Indices::contiWEqIdx] = 0;
-            values[Indices::contiNEqIdx] = 0;
+            values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0;
+            values[Indices::conti0EqIdx + FluidSystem::NAPLIdx] = 0;
         }
 
         return values;
@@ -226,7 +226,7 @@ public:
 
     {
         PrimaryVariables values(0.0);
-        values.setState(Indices::wPhaseOnly);
+        values.setState(Indices::firstPhaseOnly);
 
         values[Indices::pressureIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]); // 200 kPa = 2 bar
         values[Indices::switchIdx] = 0.0;
diff --git a/tutorial/ex3/2pproblem.hh b/tutorial/ex3/2pproblem.hh
index 4b3e41e1fdb992600e96a245f9657d4f37769300..0d79a848bfc5a2a15f04f479c8055e77e5761287 100644
--- a/tutorial/ex3/2pproblem.hh
+++ b/tutorial/ex3/2pproblem.hh
@@ -110,13 +110,20 @@ class ExerciseThreeProblemTwoP : public PorousMediumFlowProblem<TypeTag>
     using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
 
     // Dumux specific types
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
 
+    enum {
+        waterPressureIdx = Indices::pressureIdx,
+        naplSaturationIdx = Indices::saturationIdx,
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::comp0Idx, // water transport equation index
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::comp1Idx // napl transport equation index
+    };
+
 public:
     ExerciseThreeProblemTwoP(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry)
@@ -196,8 +203,8 @@ public:
     {
         PrimaryVariables priVars;
 
-        priVars[Indices::pwIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]); // 200 kPa = 2 bar
-        priVars[Indices::snIdx] = 0.0; // 0 % oil saturation on left boundary
+        priVars[waterPressureIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]); // 200 kPa = 2 bar
+        priVars[naplSaturationIdx] = 0.0; // 0 % oil saturation on left boundary
        return priVars;
     }
 
@@ -221,12 +228,12 @@ public:
         // extraction of oil on the right boundary for approx. 1.e6 seconds
         if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40) {
             // oil outflux of 30 g/(m * s) on the right boundary.
-            values[Indices::contiWEqIdx] = 0;
-            values[Indices::contiNEqIdx] = -3e-2;
+            values[contiWEqIdx] = 0;
+            values[contiNEqIdx] = -3e-2;
         } else {
             // no-flow on the remaining Neumann-boundaries.
-            values[Indices::contiWEqIdx] = 0;
-            values[Indices::contiNEqIdx] = 0;
+            values[contiWEqIdx] = 0;
+            values[contiNEqIdx] = 0;
         }
 
         return values;
@@ -252,8 +259,8 @@ public:
     {
         PrimaryVariables values(0.0);
 
-        values[Indices::pwIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]); // 200 kPa = 2 bar
-        values[Indices::snIdx] = 0.0;
+        values[waterPressureIdx] = 200.0e3 + 9.81*1000*(depthBOR_ - globalPos[dimWorld-1]); // 200 kPa = 2 bar (pw)
+        values[naplSaturationIdx] = 0.0; // (sn)
 
         return values;
     }
diff --git a/tutorial/ex3/fluidsystems/h2omycompressiblecomponent.hh b/tutorial/ex3/fluidsystems/h2omycompressiblecomponent.hh
index 43c84c8a0e6813ad1ae7df110253bcc27248c4a6..e98c1a011f39db1f15f39084de77035e5e975612 100644
--- a/tutorial/ex3/fluidsystems/h2omycompressiblecomponent.hh
+++ b/tutorial/ex3/fluidsystems/h2omycompressiblecomponent.hh
@@ -58,20 +58,19 @@ public:
     typedef Dumux::MyCompressibleComponent<Scalar> MyCompressibleComponent;
     typedef H2OType H2O;
 
-    static const int numPhases = 2;
-    static const int numComponents = 2;
+    static constexpr int numPhases = 2;
+    static constexpr int numComponents = 2;
 
-    static const int wPhaseIdx = 0; // index of the water phase
-    static const int nPhaseIdx = 1; // index of the NAPL phase
-
-    static const int H2OIdx = 0;
-    static const int NAPLIdx = 1;
+    static constexpr int phase0Idx = 0; // index of the first phase
+    static constexpr int phase1Idx = 1; // index of the second phase
 
+    static constexpr int H2OIdx = 0;
+    static constexpr int NAPLIdx = 1;
     // export component indices to indicate the main component
     // of the corresponding phase at atmospheric pressure 1 bar
     // and room temperature 20°C:
-    static const int wCompIdx = H2OIdx;
-    static const int nCompIdx = NAPLIdx;
+    static constexpr int comp0Idx = H2OIdx;
+    static constexpr int comp1Idx = NAPLIdx;
 
     /*!
      * \brief Initialize the fluid system's static parameters generically
@@ -119,13 +118,13 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isLiquid(int phaseIdx)
+    static constexpr bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         return true;
     }
 
-    static bool isIdealGas(int phaseIdx)
+    static constexpr bool isIdealGas(int phaseIdx)
     { return H2O::gasIsIdeal() && MyCompressibleComponent::gasIsIdeal(); }
 
     /*!
@@ -142,7 +141,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealMixture(int phaseIdx)
+    static constexpr bool isIdealMixture(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         return true;
@@ -157,10 +156,10 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isCompressible(int phaseIdx)
+    static constexpr bool isCompressible(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
             // the water component decides for the water phase...
             return H2O::liquidIsCompressible();
 
@@ -174,8 +173,8 @@ public:
     static std::string phaseName(int phaseIdx)
     {
         switch (phaseIdx) {
-        case wPhaseIdx: return "w";
-        case nPhaseIdx: return "n";
+        case phase0Idx: return "w";
+        case phase1Idx: return "n";
         };
         DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
     }
@@ -213,15 +212,15 @@ public:
     static Scalar density(const FluidState &fluidState, int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             // See: doctoral thesis of Steffen Ochs 2007
             // Steam injection into saturated porous media : process analysis including experimental and numerical investigations
             // http://elib.uni-stuttgart.de/bitstream/11682/271/1/Diss_Ochs_OPUS.pdf
 
             // Scalar rholH2O = H2O::liquidDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
             // Scalar clH2O = rholH2O/H2O::molarMass();
-            // Scalar x_H2O = fluidState.moleFraction(wPhaseIdx, H2OIdx);
-            // Scalar x_myComp = fluidState.moleFraction(wPhaseIdx, NAPLIdx);
+            // Scalar x_H2O = fluidState.moleFraction phase0Idx, H2OIdx);
+            // Scalar x_myComp = fluidState.moleFraction phase0Idx, NAPLIdx);
 
             /*!
              * TODO: implement the composition-dependent water density from the exercise sheet.
@@ -244,7 +243,7 @@ public:
                             int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             // assume pure water viscosity
             return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
                                         fluidState.pressure(phaseIdx));
@@ -303,10 +302,10 @@ public:
         const Scalar T = fluidState.temperature(phaseIdx);
         const Scalar p = fluidState.pressure(phaseIdx);
 
-        if (compIdx == NAPLIdx && phaseIdx == wPhaseIdx)
+        if (compIdx == NAPLIdx && phaseIdx == phase0Idx)
             return Dumux::BinaryCoeff::H2O_MyCompressibleComponent::henryMyCompressibleComponentInWater(T)/p;
 
-        else if (phaseIdx == nPhaseIdx && compIdx == H2OIdx)
+        else if (phaseIdx == phase1Idx && compIdx == H2OIdx)
             return Dumux::BinaryCoeff::H2O_MyCompressibleComponent::henryWaterInMyCompressibleComponent(T)/p;
 
         else
@@ -339,7 +338,7 @@ public:
         Scalar T = fluidState.temperature(phaseIdx);
         Scalar p = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             if (compIdx == H2OIdx)
                 return H2O::vaporPressure(T)/p;
             else if (compIdx == NAPLIdx)
@@ -432,7 +431,7 @@ public:
 
         const Scalar temperature  = fluidState.temperature(phaseIdx) ;
         const Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             return H2O::liquidThermalConductivity(temperature, pressure);
         }
diff --git a/tutorial/ex3/spatialparams.hh b/tutorial/ex3/spatialparams.hh
index 954385ae1a5daa9bdaf7b7e4b0e8dedbc337d65d..1bec0b8356e52e137cd8159a737b63bc59784a10 100644
--- a/tutorial/ex3/spatialparams.hh
+++ b/tutorial/ex3/spatialparams.hh
@@ -118,13 +118,23 @@ public:
      *
      * \return the material parameters object
      */
-     const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
+    const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
     {
         if (isInLens(globalPos))
             return materialParamsLens_;
         return materialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::phase0Idx; }
+
     /*!
      * \brief The constructor
      *
diff --git a/tutorial/solution/ex1/CMakeLists.txt b/tutorial/solution/ex1/CMakeLists.txt
index 7e261939f9faf0795264e54dd70cb2401a9d88bc..1b245486c92a54041492238657595282b0f6f351 100644
--- a/tutorial/solution/ex1/CMakeLists.txt
+++ b/tutorial/solution/ex1/CMakeLists.txt
@@ -15,7 +15,7 @@ dune_add_test(NAME exercise1_2pni_solution
 
 
 # add tutorial to the common target
-add_dependencies(build_tutorials exercise1_2pni_solution)
+add_dependencies(build_tutorials exercise1_2p2c_solution exercise1_2pni_solution)
 
 # add a symlink for the input file
 dune_symlink_to_source_files(FILES "exercise1.input")
diff --git a/tutorial/solution/ex1/injection2p2cproblem.hh b/tutorial/solution/ex1/injection2p2cproblem.hh
index 2632ff0bc3f3d8caf4815fc0b1f54b433e33e7a0..fad1fdf151ed88f4ed2bbf74d7d9a39658b21f2d 100644
--- a/tutorial/solution/ex1/injection2p2cproblem.hh
+++ b/tutorial/solution/ex1/injection2p2cproblem.hh
@@ -82,7 +82,7 @@ class Injection2p2cProblem : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
@@ -92,6 +92,11 @@ class Injection2p2cProblem : public PorousMediumFlowProblem<TypeTag>
     enum { dimWorld = GridView::dimensionworld };
     using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
 
+    enum {
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx, // water transport equation index
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx, // nitrogen transport equation index
+    };
+
 public:
     Injection2p2cProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry)
@@ -195,8 +200,8 @@ public:
 
             // inject nitrogen. negative values mean injection
             // convert from units kg/(s*m^2) to mole/(s*m^2)
-            values[Indices::contiNEqIdx] = totalAreaSpecificInflow_/FluidSystem::molarMass(FluidSystem::nCompIdx);
-            values[Indices::contiWEqIdx] = 0.0;
+            values[contiNEqIdx] = totalAreaSpecificInflow_/FluidSystem::molarMass(FluidSystem::N2Idx);
+            values[contiWEqIdx] = 0.0;
         }
 
         return values;
@@ -221,7 +226,7 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values.setState(Indices::wPhaseOnly);
+        values.setState(Indices::firstPhaseOnly);
         // get the water density at atmospheric conditions
         const Scalar densityW = FluidSystem::H2O::liquidDensity(temperature(), 1.0e5);
 
diff --git a/tutorial/solution/ex1/injection2pniproblem.hh b/tutorial/solution/ex1/injection2pniproblem.hh
index 3bc55865993078b001cd804a4052574837a870ba..20fda3e097452508581184fb22f191af71393d45 100644
--- a/tutorial/solution/ex1/injection2pniproblem.hh
+++ b/tutorial/solution/ex1/injection2pniproblem.hh
@@ -80,7 +80,7 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
     using ParentType = PorousMediumFlowProblem<TypeTag>;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
@@ -90,6 +90,12 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
     enum { dimWorld = GridView::dimensionworld };
     using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
 
+    enum {
+        contiWEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx, // water transport equation index
+        contiNEqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx, // nitrogen transport equation index
+        energyEqIdx = Indices::energyEqIdx,
+    };
+
 public:
     InjectionProblem2PNI(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry)
@@ -181,9 +187,9 @@ public:
         {
             // inject nitrogen. negative values mean injection
             // units kg/(s*m^2)
-            values[Indices::contiNEqIdx] = -1e-4;
-            values[Indices::contiWEqIdx] = 0.0;
-            values[Indices::energyEqIdx] = 0.0;
+            values[contiNEqIdx] = -1e-4;
+            values[contiWEqIdx] = 0.0;
+            values[energyEqIdx] = 0.0;
         }
 
         return values;
diff --git a/tutorial/solution/ex1/injection2pspatialparams.hh b/tutorial/solution/ex1/injection2pspatialparams.hh
index 0741103053f0600a77e156125b59d2ef3e47face..3b087bafff89ec9655d51e8e4afa259385759f6b 100644
--- a/tutorial/solution/ex1/injection2pspatialparams.hh
+++ b/tutorial/solution/ex1/injection2pspatialparams.hh
@@ -144,13 +144,23 @@ public:
      *
      * \return the material parameters object
      */
-     const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
+    const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
     {
         if (isInAquitard_(globalPos))
             return aquitardMaterialParams_;
         return aquiferMaterialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
     /*!
      *  These parameters are only needed for nonisothermal models. Comment them in if you want to implement the 2pni model.
      */
diff --git a/tutorial/solution/ex2/injection2p2cproblem.hh b/tutorial/solution/ex2/injection2p2cproblem.hh
index 453f673fa4802f68d75eb43cb47d0522d9f27446..7ab57db74602f95f0001c8900d726f465b174fb1 100644
--- a/tutorial/solution/ex2/injection2p2cproblem.hh
+++ b/tutorial/solution/ex2/injection2p2cproblem.hh
@@ -94,7 +94,8 @@ class Injection2p2cProblem : public PorousMediumFlowProblem<TypeTag>
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
+    using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
     using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
@@ -194,10 +195,10 @@ public:
      * For this method, the \a values parameter stores the mass flux
      * in normal direction of each phase. Negative values mean influx.
      */
-    PrimaryVariables neumannAtPos(const GlobalPosition &globalPos) const
+    NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
     {
         // initialize values to zero, i.e. no-flow Neumann boundary conditions
-        PrimaryVariables values(0.0);
+        NumEqVector values(0.0);
 
         //if we are inside the injection zone set inflow Neumann boundary conditions
         if (time_ < injectionDuration_
@@ -205,8 +206,7 @@ public:
         {
             // set the Neumann values for the Nitrogen component balance
             // convert from units kg/(s*m^2) to mole/(s*m^2)
-            values[Indices::contiNEqIdx] = -totalAreaSpecificInflow_/FluidSystem::molarMass(FluidSystem::nCompIdx);
-            values[Indices::contiWEqIdx] = 0.0;
+            values[Indices::conti0EqIdx + FluidSystem::N2Idx] = -totalAreaSpecificInflow_/FluidSystem::molarMass(FluidSystem::N2Idx);
         }
 
         return values;
@@ -230,7 +230,7 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values.setState(Indices::wPhaseOnly);
+        values.setState(Indices::firstPhaseOnly);
 
         // get the water density at atmospheric conditions
         const Scalar densityW = FluidSystem::H2O::liquidDensity(temperature(), 1.0e5);
diff --git a/tutorial/solution/ex2/injection2p2cspatialparams.hh b/tutorial/solution/ex2/injection2p2cspatialparams.hh
index 3c4d63d8ac54cc0501df2167b53b2be5fbb2f8a0..561d42ae42cbd1ae5df36c653d314fa66643d1f9 100644
--- a/tutorial/solution/ex2/injection2p2cspatialparams.hh
+++ b/tutorial/solution/ex2/injection2p2cspatialparams.hh
@@ -167,6 +167,16 @@ public:
         return aquiferMaterialParams_;
     }
 
+    /*!
+     * \brief Function for defining which phase is to be considered as the wetting phase.
+     *
+     * \return the wetting phase index
+     * \param globalPos The position of the center of the element
+     */
+    template<class FluidSystem>
+    int wettingPhaseAtPos(const GlobalPosition& globalPos) const
+    { return FluidSystem::H2OIdx; }
+
     /*!
      * \brief Creates a gnuplot output of the pc-Sw curve
      */
diff --git a/tutorial/solution/ex2/mylocalresidual.hh b/tutorial/solution/ex2/mylocalresidual.hh
index 0f3fa62ea9caf386a10a92f31f6665da2b0d2845..8723eb71cf662cb230526d9a84999f39fdabc1e7 100644
--- a/tutorial/solution/ex2/mylocalresidual.hh
+++ b/tutorial/solution/ex2/mylocalresidual.hh
@@ -50,7 +50,7 @@ class MyCompositionalLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResid
     using ResidualVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
     using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
     using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView;
-    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
+    using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Element = typename GridView::template Codim<0>::Entity;
     using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
diff --git a/tutorial/solution/ex3/h2omycompressiblecomponent.hh b/tutorial/solution/ex3/h2omycompressiblecomponent.hh
index e9ce1ed89bc80e3117beab375fb70acd53fbb499..80995530eba36be1ebe54ea3047eb731ad14b8f4 100644
--- a/tutorial/solution/ex3/h2omycompressiblecomponent.hh
+++ b/tutorial/solution/ex3/h2omycompressiblecomponent.hh
@@ -58,20 +58,19 @@ public:
     typedef Dumux::MyCompressibleComponent<Scalar> MyCompressibleComponent;
     typedef H2OType H2O;
 
-    static const int numPhases = 2;
-    static const int numComponents = 2;
+    static constexpr int numPhases = 2;
+    static constexpr int numComponents = 2;
 
-    static const int wPhaseIdx = 0; // index of the water phase
-    static const int nPhaseIdx = 1; // index of the NAPL phase
-
-    static const int H2OIdx = 0;
-    static const int NAPLIdx = 1;
+    static constexpr int phase0Idx = 0; // index of the first phase
+    static constexpr int phase1Idx = 1; // index of the second phase
 
+    static constexpr int H2OIdx = 0;
+    static constexpr int NAPLIdx = 1;
     // export component indices to indicate the main component
     // of the corresponding phase at atmospheric pressure 1 bar
     // and room temperature 20°C:
-    static const int wCompIdx = H2OIdx;
-    static const int nCompIdx = NAPLIdx;
+    static constexpr int comp0Idx = H2OIdx;
+    static constexpr int comp1Idx = NAPLIdx;
 
     /*!
      * \brief Initialize the fluid system's static parameters generically
@@ -119,13 +118,13 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isLiquid(int phaseIdx)
+    static constexpr bool isLiquid(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         return true;
     }
 
-    static bool isIdealGas(int phaseIdx)
+    static constexpr bool isIdealGas(int phaseIdx)
     { return H2O::gasIsIdeal() && MyCompressibleComponent::gasIsIdeal(); }
 
     /*!
@@ -142,7 +141,7 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isIdealMixture(int phaseIdx)
+    static constexpr bool isIdealMixture(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
         return true;
@@ -157,10 +156,10 @@ public:
      *
      * \param phaseIdx The index of the fluid phase to consider
      */
-    static bool isCompressible(int phaseIdx)
+    static constexpr bool isCompressible(int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
             // the water component decides for the water phase...
             return H2O::liquidIsCompressible();
 
@@ -174,8 +173,8 @@ public:
     static std::string phaseName(int phaseIdx)
     {
         switch (phaseIdx) {
-        case wPhaseIdx: return "w";
-        case nPhaseIdx: return "n";
+        case phase0Idx: return "w";
+        case phase1Idx: return "n";
         };
         DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
     }
@@ -213,14 +212,14 @@ public:
     static Scalar density(const FluidState &fluidState, int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             // See: doctoral thesis of Steffen Ochs 2007
             // Steam injection into saturated porous media : process analysis including experimental and numerical investigations
             // http://elib.uni-stuttgart.de/bitstream/11682/271/1/Diss_Ochs_OPUS.pdf
             Scalar rholH2O = H2O::liquidDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
             Scalar clH2O = rholH2O/H2O::molarMass();
-            Scalar x_H2O = fluidState.moleFraction(wPhaseIdx, H2OIdx);
-            Scalar x_myComp = fluidState.moleFraction(wPhaseIdx, NAPLIdx);
+            Scalar x_H2O = fluidState.moleFraction(phase0Idx, H2OIdx);
+            Scalar x_myComp = fluidState.moleFraction(phase0Idx, NAPLIdx);
 
             // return composition-dependent water phase density
             return clH2O*(H2O::molarMass()*x_H2O + MyCompressibleComponent::molarMass()*x_myComp);
@@ -241,7 +240,7 @@ public:
                             int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             // assume pure water viscosity
             return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
                                         fluidState.pressure(phaseIdx));
@@ -300,10 +299,10 @@ public:
         const Scalar T = fluidState.temperature(phaseIdx);
         const Scalar p = fluidState.pressure(phaseIdx);
 
-        if (compIdx == NAPLIdx && phaseIdx == wPhaseIdx)
+        if (compIdx == NAPLIdx && phaseIdx == phase0Idx)
             return Dumux::BinaryCoeff::H2O_MyCompressibleComponent::henryMyCompressibleComponentInWater(T)/p;
 
-        else if (phaseIdx == nPhaseIdx && compIdx == H2OIdx)
+        else if (phaseIdx == phase1Idx && compIdx == H2OIdx)
             return Dumux::BinaryCoeff::H2O_MyCompressibleComponent::henryWaterInMyCompressibleComponent(T)/p;
 
         else
@@ -336,7 +335,7 @@ public:
         Scalar T = fluidState.temperature(phaseIdx);
         Scalar p = fluidState.pressure(phaseIdx);
 
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             if (compIdx == H2OIdx)
                 return H2O::vaporPressure(T)/p;
             else if (compIdx == NAPLIdx)
@@ -410,7 +409,7 @@ public:
                            int phaseIdx)
     {
         assert(0 <= phaseIdx && phaseIdx < numPhases);
-        if (phaseIdx == wPhaseIdx) {
+        if (phaseIdx == phase0Idx) {
             return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
         }
         else {
@@ -436,7 +435,7 @@ public:
 
         const Scalar temperature  = fluidState.temperature(phaseIdx) ;
         const Scalar pressure = fluidState.pressure(phaseIdx);
-        if (phaseIdx == wPhaseIdx)
+        if (phaseIdx == phase0Idx)
         {
             return H2O::liquidThermalConductivity(temperature, pressure);
         }