diff --git a/dune/tectonic/globallaursennonlinearity.hh b/dune/tectonic/globallaursennonlinearity.hh
index b1d845441e0b08af713fb46e8a92fb7d19a0b7b3..c6a8ef9281a1f36c5c0169e407bb610c362bd6cc 100644
--- a/dune/tectonic/globallaursennonlinearity.hh
+++ b/dune/tectonic/globallaursennonlinearity.hh
@@ -6,11 +6,11 @@
 #include <dune/common/fvector.hh>
 
 #include "globalnonlinearity.hh"
+#include "nicefunction.hh"
 
 namespace Dune {
 template <int dim, class OuterFunctionType>
-class GlobalLaursenNonlinearity
-    : public Dune::GlobalNonlinearity<dim, OuterFunctionType> {
+class GlobalLaursenNonlinearity : public Dune::GlobalNonlinearity<dim> {
 public:
   GlobalLaursenNonlinearity(
       std::vector<double> const &coefficientOfFriction,
@@ -34,11 +34,11 @@ class GlobalLaursenNonlinearity
 
     sigma_n [id + mu id] = sigma_n (1 + mu) id
   */
-  OuterFunctionType restriction(int i) const {
+  virtual Dune::NiceFunction *restriction(int i) const {
     double coefficient = nodalIntegrals[i][0];
     coefficient *= normalStress[i];
     coefficient *= 1 + coefficientOfFriction[i];
-    return OuterFunctionType(coefficient);
+    return new OuterFunctionType(coefficient);
   }
 
 private:
diff --git a/dune/tectonic/globalnonlinearity.hh b/dune/tectonic/globalnonlinearity.hh
index 8ed3bb38d2a34854d0dbb79c7838a2de0a8fbe22..7915f9ae636d09c4ff3de0bb973842b2e02e4f62 100644
--- a/dune/tectonic/globalnonlinearity.hh
+++ b/dune/tectonic/globalnonlinearity.hh
@@ -5,13 +5,15 @@
 
 #include <dune/common/fvector.hh>
 
+#include "nicefunction.hh"
+
 namespace Dune {
-template <int dim, class OuterFunctionType> class GlobalNonlinearity {
+template <int dim> class GlobalNonlinearity {
 public:
   /*
     Return a restriction of the outer function to the i'th node. If
   */
-  virtual OuterFunctionType restriction(int i) const = 0;
+  virtual NiceFunction* restriction(int i) const = 0;
 };
 }
 #endif
diff --git a/dune/tectonic/globalruinanonlinearity.hh b/dune/tectonic/globalruinanonlinearity.hh
index aed666530af1f2c876e53ad5d7c96991349aa652..8a05c73ded8d2ee0113f1bb3163f7e236292ab61 100644
--- a/dune/tectonic/globalruinanonlinearity.hh
+++ b/dune/tectonic/globalruinanonlinearity.hh
@@ -5,13 +5,12 @@
 
 #include <dune/common/fvector.hh>
 
-#include "localnonlinearity.hh"
+#include "nicefunction.hh"
 #include "globalnonlinearity.hh"
 
 namespace Dune {
 template <int dim>
-class GlobalRuinaNonlinearity
-    : public Dune::GlobalNonlinearity<dim, Dune::RuinaFunction> {
+class GlobalRuinaNonlinearity : public Dune::GlobalNonlinearity<dim> {
 public:
   GlobalRuinaNonlinearity(
       std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
@@ -27,10 +26,10 @@ class GlobalRuinaNonlinearity
   /*
     Return a restriction of the outer function to the i'th node.
   */
-  RuinaFunction virtual restriction(int i) const {
-    return Dune::RuinaFunction(nodalIntegrals[i][0], a[i],
-                               coefficientOfFriction[i], eta[i],
-                               normalStress[i]);
+  virtual Dune::NiceFunction *restriction(int i) const {
+    return new Dune::RuinaFunction(nodalIntegrals[i][0], a[i],
+                                   coefficientOfFriction[i], eta[i],
+                                   normalStress[i]);
   }
 
 private:
diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh
index cb285c015d5027b43a4bcface66e0d672e1b3c7b..e4ff4a5da298a50b121c94dc333f9a6659cb9b6d 100644
--- a/dune/tectonic/myblockproblem.hh
+++ b/dune/tectonic/myblockproblem.hh
@@ -17,7 +17,6 @@
 template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
 public:
   typedef MyConvexProblemTypeTEMPLATE MyConvexProblemType;
-  typedef typename MyConvexProblemType::FunctionType FunctionType;
   typedef typename MyConvexProblemType::VectorType VectorType;
   typedef typename MyConvexProblemType::MatrixType MatrixType;
   typedef typename MyConvexProblemType::LocalVectorType LocalVectorType;
@@ -115,7 +114,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
       assert(localA != NULL);
 
       auto const f = problem.phi.restriction(m);
-      Dune::LocalNonlinearity<block_size> const phi(f);
+      Dune::LocalNonlinearity<block_size> const phi(*f);
       Dune::SampleFunctional<block_size> localJ(*localA, localb, phi,
                                                 ignore_component);
 
diff --git a/dune/tectonic/myconvexproblem.hh b/dune/tectonic/myconvexproblem.hh
index 588aa381594ea297035d920699ab4a49755ea4e4..5d70df27ff3bd949360585eb38900f48cd1150e5 100644
--- a/dune/tectonic/myconvexproblem.hh
+++ b/dune/tectonic/myconvexproblem.hh
@@ -10,11 +10,9 @@
     \tparam MatrixTypeTEMPLATE The type used for the matrix of the quadratic
    part
 */
-template <class MatrixTypeTEMPLATE, class VectorTypeTEMPLATE,
-          class FunctionTypeTEMPLATE>
+template <class MatrixTypeTEMPLATE, class VectorTypeTEMPLATE>
 class MyConvexProblem {
 public:
-  typedef FunctionTypeTEMPLATE FunctionType;
   typedef VectorTypeTEMPLATE VectorType;
   typedef MatrixTypeTEMPLATE MatrixType;
   typedef typename VectorType::block_type LocalVectorType;
@@ -29,12 +27,12 @@ class MyConvexProblem {
       \param u The solution vector
   */
   MyConvexProblem(MatrixType const &A,
-                  Dune::GlobalNonlinearity<block_size, FunctionType> &phi,
+                  Dune::GlobalNonlinearity<block_size> &phi,
                   VectorType const &f, VectorType &u)
       : A(A), phi(phi), f(f), u(u) {};
 
   MatrixType const &A;
-  Dune::GlobalNonlinearity<block_size, FunctionType> const &phi;
+  Dune::GlobalNonlinearity<block_size> const &phi;
 
   VectorType const &f;
 
diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 55d087ca9b0b203eb3eac131099b9de7604f0481..595341b128e706e607296c5253d33013fd17fe7f 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -185,10 +185,7 @@ int main(int argc, char *argv[]) {
     setup_boundary(leafView, end_points, ignoreNodes, neumannNodes,
                    frictionalNodes);
 
-    typedef MyConvexProblem<OperatorType, VectorType, Dune::LinearFunction>
-    MyConvexProblemType;
-    // typedef MyConvexProblem<OperatorType, VectorType, Dune::RuinaFunction>
-    // MyConvexProblemType;
+    typedef MyConvexProblem<OperatorType, VectorType> MyConvexProblemType;
     typedef MyBlockProblem<MyConvexProblemType> MyBlockProblemType;
     GenericNonlinearGS<MyBlockProblemType> nonlinearGSStep;
     nonlinearGSStep.ignoreNodes_ = &ignoreNodes;