diff --git a/dune/fufem/estimators/hierarchicalestimator.hh b/dune/fufem/estimators/hierarchicalestimator.hh
index 266e5f27070f9004ec1b8157bce998a5af9eca01..311975f3ed7bab9dac61b20f8d6b113782e74f18 100644
--- a/dune/fufem/estimators/hierarchicalestimator.hh
+++ b/dune/fufem/estimators/hierarchicalestimator.hh
@@ -88,13 +88,10 @@ public:
 
         refinementIndicator.clear();
 
-        typename GridType::LeafGridView::template Codim<0>::Iterator eIt    = grid_->template leafbegin<0>();
-        typename GridType::LeafGridView::template Codim<0>::Iterator eEndIt = grid_->template leafend<0>();
-
         // Extract all contributions that correspond to edges
-        for (; eIt!=eEndIt; ++eIt) {
+        for (const auto& e : elements(grid_->leafGridView())) {
 
-            const Lfe& lfe = enlargedGlobalBasis.getLocalFiniteElement(*eIt);
+            const Lfe& lfe = enlargedGlobalBasis.getLocalFiniteElement(e);
 
             int numLocalDofs = lfe.localCoefficients().size();
 
@@ -103,12 +100,12 @@ public:
                 int codim     = lfe.localCoefficients().localKey(j).codim();
                 int subEntity = lfe.localCoefficients().localKey(j).subEntity();
 
-                unsigned int globalIdx = enlargedGlobalBasis.index(*eIt, j);
+                unsigned int globalIdx = enlargedGlobalBasis.index(e, j);
 
                 if (codim==dim)
                     assert(hierarchicalError_[globalIdx].two_norm() < 1e-5);
 
-                refinementIndicator.set(*eIt, codim, subEntity, hierarchicalError_[globalIdx].two_norm());
+                refinementIndicator.set(e, codim, subEntity, hierarchicalError_[globalIdx].two_norm());
 
             }
 
@@ -168,13 +165,10 @@ public:
 
         refinementIndicator.clear();
 
-        typename GridType::LeafGridView::template Codim<0>::Iterator eIt    = grid_->template leafbegin<0>();
-        typename GridType::LeafGridView::template Codim<0>::Iterator eEndIt = grid_->template leafend<0>();
-
         // Extract all contributions that correspond to edges
-        for (; eIt!=eEndIt; ++eIt) {
+        for (const auto& e : elements(grid_->leafGridView())) {
 
-            const Lfe& lfe = enlargedGlobalBasis.getLocalFiniteElement(*eIt);
+            const Lfe& lfe = enlargedGlobalBasis.getLocalFiniteElement(e);
             int numLocalDofs = lfe.localCoefficients().size();
 
             for (int j=0; j<numLocalDofs; j++) {
@@ -182,12 +176,12 @@ public:
                 int codim     = lfe.localCoefficients().localKey(j).codim();
                 int subEntity = lfe.localCoefficients().localKey(j).subEntity();
 
-                unsigned int globalIdx = enlargedGlobalBasis.index(*eIt, j);
+                unsigned int globalIdx = enlargedGlobalBasis.index(e, j);
 
              //   if (codim==dim)
               //      assert(hierarchicalError_[globalIdx].two_norm() < 1e-5);
 
-                refinementIndicator.set(*eIt, codim, subEntity, hierarchicalError_[globalIdx].two_norm());
+                refinementIndicator.set(e, codim, subEntity, hierarchicalError_[globalIdx].two_norm());
 
             }