diff --git a/AMDiS/src/AMDiS_fwd.h b/AMDiS/src/AMDiS_fwd.h
index 33091ba2aaf14c8b928a12cdc8c864edb696ca46..ae8b776b9da9a8cde841b25e541e1de357916062 100644
--- a/AMDiS/src/AMDiS_fwd.h
+++ b/AMDiS/src/AMDiS_fwd.h
@@ -70,6 +70,7 @@ namespace AMDiS {
   template<typename T>                                 class MatVecMultiplier;
   template<typename T>                                 class SolverMatrix;
   template<typename T>                                 class Vector;
+  template<typename T>                                 class WorldVector;
 
   template <typename ITLSolver>    class ITL_OEMSolver;
 
diff --git a/AMDiS/src/CoarseningManager.h b/AMDiS/src/CoarseningManager.h
index 4e88dcf96c39e2205dbde3e194f01fa2f929d2d9..2950709fb2f8f54e2a6e38783caf46df6f718a8b 100644
--- a/AMDiS/src/CoarseningManager.h
+++ b/AMDiS/src/CoarseningManager.h
@@ -22,32 +22,13 @@
 #ifndef AMDIS_COARSENINGMANAGER_H
 #define AMDIS_COARSENINGMANAGER_H
 
-// ============================================================================
-// ===== includes =============================================================
-// ============================================================================
-
 #include "Global.h"
 #include "Mesh.h"
 #include "ProblemStatBase.h"
+#include "AMDiS_fwd.h"
 
 namespace AMDiS {
 
-  // ============================================================================
-  // ===== forward declarations =================================================
-  // ============================================================================
-
-  class Element;
-  class Line;
-  class Triangle;
-  class Tetrahedron;
-  class RCNeighbourList;
-  class ElInfo;
-  class TraverseStack;
-
-  // ============================================================================
-  // ===== class CoarseningManager ==============================================
-  // ============================================================================
-
   /** \ingroup Adaption
    * \brief
    * Base class of CoarseningManager1d, CoarseningManager2d, CoarseningManager3d.
@@ -57,22 +38,19 @@ namespace AMDiS {
   class CoarseningManager
   {
   public:
-    /** \brief
-     * constructs a CoarseningManager which belongs to aMesh 
-     */
+    /// Constructs a CoarseningManager which belongs to aMesh 
     CoarseningManager() 
-      : mesh(NULL),  stack(NULL), globalMark(0), doMore(0) 
-    {};
+      : mesh(NULL), 
+	stack(NULL), 
+	globalMark(0), 
+	doMore(0) 
+    {}
 
-    /** \brief
-     * destructor
-     */
-    virtual ~CoarseningManager() {};
+    /// destructor
+    virtual ~CoarseningManager() {}
 
-    /** \brief
-     * Returns the Mesh the CoarseningManager belongs to.
-     */
-    inline Mesh* getMesh() { return mesh; };
+    /// Returns the Mesh the CoarseningManager belongs to.
+    inline Mesh* getMesh() { return mesh; }
 
     /** \brief
      * Tries to coarsen every element of mesh at least mark times. First
@@ -108,45 +86,29 @@ namespace AMDiS {
      */
     void spreadCoarsenMark();
 
-    /** \brief
-     * Used while traversal in spreadCoarsenMark
-     */
+    /// Used while traversal in spreadCoarsenMark
     static int spreadCoarsenMarkFunction(ElInfo* el_info);
 
-    /** \brief
-     *Used while traversal in cleanUpAfterCoarsen
-     */
+    /// Used while traversal in cleanUpAfterCoarsen
     static int cleanUpAfterCoarsenFunction(ElInfo* el_info);
 
-    /** \brief
-     * Sets the mark on all elements that have to be coarsend 
-     */
+    /// Sets the mark on all elements that have to be coarsend 
     static int coarsenMarkFunction(ElInfo *el_info);
 
-    /** \brief
-     * Resets the element marks
-     */
+    /// Resets the element marks
     void cleanUpAfterCoarsen();
 
   protected:
-    /** \brief
-     * the Mesh this CoarseningManager belongs to
-     */
-    Mesh   *mesh;
+    /// The Mesh this CoarseningManager belongs to.
+    Mesh *mesh;
 
-    /** \brief
-     * Used for non recursive mesh traversal.
-     */
+    /// Used for non recursive mesh traversal.
     TraverseStack *stack;
 
-    /** \brief
-     * Used by globalCoarsen to remember the given mark value
-     */
-    int  globalMark;
+    /// Used by globalCoarsen to remember the given mark value
+    int globalMark;
 
-    /** \brief
-     * Spezifies whether the coarsening operation is still in progress
-     */
+    /// Spezifies whether the coarsening operation is still in progress
     bool doMore;
 
     /** \brief
@@ -155,9 +117,7 @@ namespace AMDiS {
      */
     static CoarseningManager* traversePtr;
 
-    /** \brief
-     * Spezifies how many DOFVectors should restricted while coarsening
-     */
+    /// Spezifies how many DOFVectors should restricted while coarsening
     int callCoarseRestrict;
 
     friend class RCNeighbourList;
diff --git a/AMDiS/src/DOFMatrix.cc b/AMDiS/src/DOFMatrix.cc
index 946d1e5873be465fef9f5c39e0c042ebca8c6532..afa329059e83a67293b50806463a8a8b3a74758a 100644
--- a/AMDiS/src/DOFMatrix.cc
+++ b/AMDiS/src/DOFMatrix.cc
@@ -55,7 +55,7 @@ namespace AMDiS {
 
     applyDBCs.clear();
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     applicationOrdering = NULL;
 #endif
   }
diff --git a/AMDiS/src/DOFMatrix.h b/AMDiS/src/DOFMatrix.h
index 25d5172379927a41271ce77a108dac40c9ad0ac6..6fb487721ae41f83bae15be28afa32942ee0d19c 100644
--- a/AMDiS/src/DOFMatrix.h
+++ b/AMDiS/src/DOFMatrix.h
@@ -39,7 +39,7 @@
 #include "Boundary.h"
 #include "Serializable.h"
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
 #include "petscao.h"
 #endif
 
@@ -430,7 +430,7 @@ namespace AMDiS {
     ///
     int memsize();
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     /// Sets the petsc application ordering object to map dof indices.
     void useApplicationOrdering(AO *ao) {
       applicationOrdering = ao;
@@ -495,7 +495,7 @@ namespace AMDiS {
      */    
     std::set<int> applyDBCs;
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     /// Petsc application ordering to map dof indices.
     AO *applicationOrdering;
 #endif
diff --git a/AMDiS/src/DOFVector.h b/AMDiS/src/DOFVector.h
index 7acd2856800a5d869331d040b711d7e2d05c30ff..3b4bcbf992394bf991907e6272262ce75c2dcaa7 100644
--- a/AMDiS/src/DOFVector.h
+++ b/AMDiS/src/DOFVector.h
@@ -41,7 +41,7 @@
 #include "DOFMatrix.h" 
 #include "BasisFunction.h"
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
 #include "petscao.h"
 #endif
  
@@ -517,7 +517,7 @@ namespace AMDiS {
 
     DOFVector<WorldVector<T> >* getRecoveryGradient(DOFVector<WorldVector<T> >*) const;
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     /// Sets the petsc application ordering object to map dof indices.
     void useApplicationOrdering(AO *ao) {
       applicationOrdering = ao;
@@ -559,7 +559,7 @@ namespace AMDiS {
     /// Used for mesh traversal
     static DOFVector<T> *traverseVector;
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     /// Petsc application ordering to map dof indices.
     AO *applicationOrdering;
 #endif
diff --git a/AMDiS/src/DOFVector.hh b/AMDiS/src/DOFVector.hh
index 68967f904449568c1522da8da4c0e9c699898bb8..04cd7c624e0447cd7dfdca7d253f72f9d78d6239 100644
--- a/AMDiS/src/DOFVector.hh
+++ b/AMDiS/src/DOFVector.hh
@@ -116,7 +116,7 @@ namespace AMDiS {
   {
     init(f, n);
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     applicationOrdering = NULL;
 #endif
   } 
diff --git a/AMDiS/src/DirectSolverInterface.h b/AMDiS/src/DirectSolverInterface.h
deleted file mode 100644
index cb78c18cfd5535480136d2ab79c73181ffa2a2e6..0000000000000000000000000000000000000000
--- a/AMDiS/src/DirectSolverInterface.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef AMDIS_DIRECTSOLVERINTERFACE_H
-#define AMDIS_DIRECTSOLVERINTERFACE_H
-
-namespace AMDiS {
-
-  template<typename MatrixType, typename VectorType>
-  class DirectSolverInterface
-  {    
-  public:
-    DirectSolverInterface() {};
-
-    virtual ~DirectSolverInterface() {};
-
-    virtual void solve(MatrixType &A, 
-		       VectorType &b, 
-		       VectorType &x, 
-		       int numUnknowns) = 0;
-  };
-
-}
-
-#endif
diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h
index aaf7589124c39323725651484de642aca1c03399..9841046b6bfdde4782f14b195ecbb9df28a14f0f 100644
--- a/AMDiS/src/ElInfo.h
+++ b/AMDiS/src/ElInfo.h
@@ -319,14 +319,9 @@ namespace AMDiS {
     void coordToWorld(const DimVec<double>& lambda,
 		      WorldVector<double>& world) const;
   
-
-    /** \brief
-     * Fills ElInfo's \ref det_ and \ref grdLambda entries.
-     */
+    /// Fills ElInfo's \ref det_ and \ref grdLambda entries.
     virtual void fillDetGrdLambda();
 
-    // ===== pure virtual functions. Must be overriden in sub-classes ============
-
     /** \brief
      * Returns a pointer to a vector, which contains the barycentric coordinates
      * with respect to \ref element of a point with world coordinates world.
@@ -488,7 +483,6 @@ namespace AMDiS {
      */
     DimMat<double> *subElemCoordsMat;
 
-    // ===== static public members ================================================
   public:
     /** \brief 
      * child_vertex[el_type][child][i] = father's local vertex index of new 
diff --git a/AMDiS/src/ElInfo1d.cc b/AMDiS/src/ElInfo1d.cc
index b2a2eb8cd847b66312d042ef7d918562de121a11..910ac24bcd28994bce53524242f44915943550e5 100644
--- a/AMDiS/src/ElInfo1d.cc
+++ b/AMDiS/src/ElInfo1d.cc
@@ -289,6 +289,16 @@ namespace AMDiS {
     }
   }
 
+  void ElInfo1d::getRefSimplexCoords(const BasisFunction *basisFcts,
+				     mtl::dense2D<double>& coords) const
+  {
+    TEST_EXIT(basisFcts->getDegree() == 1)("Wrong basis function degree!\n");
+
+    double deg1[][2] = {{ 1.0, 0.0 },
+			{ 0.0, 1.0 }};
+    coords = deg1;
+  }
+
   void ElInfo1d::getSubElementCoords(const BasisFunction *basisFcts,
 				     int iChild,
 				     DimMat<double> *coords) const
@@ -312,4 +322,33 @@ namespace AMDiS {
     }
   }
 
+  void ElInfo1d::getSubElementCoords(const BasisFunction *basisFcts,
+				     int iChild,
+				     mtl::dense2D<double>& coords) const
+  {
+    FUNCNAME("ElInfo1d::getSubElementCoords()");
+
+    double deg1_left[][2] = {{ 1.0, 0.5 },
+			     { 0.0, 0.5 }};
+    mtl::dense2D<double> deg1_left_mat(deg1_left);
+
+    double deg1_right[][2] = {{ 0.5, 1.0 },
+			      { 0.5, 0.0 }};
+    mtl::dense2D<double> deg1_right_mat(deg1_right);
+
+    switch (basisFcts->getDegree()) {
+    case 1:
+      if (iChild == 0)
+	coords *= deg1_left_mat;
+      else
+	coords *= deg1_right_mat;
+
+      break;
+    case 2:
+      break;
+    default:
+      ERROR_EXIT("Not yet implemented!\n");
+    }
+  }
+
 }
diff --git a/AMDiS/src/ElInfo1d.h b/AMDiS/src/ElInfo1d.h
index 81bdd5ce6eb92928f138103206807a589ee2700e..dee1d7ecca1c5e39f210722b27f011b7804778ce 100644
--- a/AMDiS/src/ElInfo1d.h
+++ b/AMDiS/src/ElInfo1d.h
@@ -22,6 +22,8 @@
 #ifndef AMDIS_ELINFO1D_H
 #define AMDIS_ELINFO1D_H
 
+#include <boost/numeric/mtl/mtl.hpp>
+
 #include "ElInfo.h"
 #include "MemoryManager.h"
 
@@ -34,8 +36,6 @@ namespace AMDiS {
   class ElInfo1d : public ElInfo
   {
   public:
-    MEMORY_MANAGED(ElInfo1d);
-
     /// Constructor. Calls ElInfo's protected Constructor.
     ElInfo1d(Mesh* aMesh) 
       : ElInfo(aMesh) 
@@ -66,10 +66,16 @@ namespace AMDiS {
     void getRefSimplexCoords(const BasisFunction *basisFcts,
 			     DimMat<double> *coords) const;
 
+    void getRefSimplexCoords(const BasisFunction *basisFcts,
+			     mtl::dense2D<double>& coords) const;
+
     void getSubElementCoords(const BasisFunction *basisFcts,
 			     int iChild,
 			     DimMat<double> *coords) const;
 
+    void getSubElementCoords(const BasisFunction *basisFcts,
+			     int iChild,
+			     mtl::dense2D<double>& coords) const;
   };
 
 }
diff --git a/AMDiS/src/ElInfoStack.h b/AMDiS/src/ElInfoStack.h
index c7d46234a9cfc44435cab9efa401404e4fbc04ac..b528c0a4b8ebc78aaac5f35024024cfd150a17d4 100644
--- a/AMDiS/src/ElInfoStack.h
+++ b/AMDiS/src/ElInfoStack.h
@@ -22,78 +22,47 @@
 #ifndef AMDIS_ELINFOSTACK_H
 #define AMDIS_ELINFOSTACK_H
 
-// ============================================================================
-// ===== includes =============================================================
-// ============================================================================
 #include <vector>
 #include "ElInfo.h"
+#include "AMDiS_fwd.h"
 
 namespace AMDiS {
 
-  // ============================================================================
-  // ===== forward declarations =================================================
-  // ============================================================================
-
-  class Mesh;
-
-
-  // ============================================================================
-  // ===== class ElInfoStack ====================================================
-  // ============================================================================
-
   /** \ingroup Traverse
    * \brief 
    * Stores a stack of ElInfo object. Is used by meshes for recursive mesh
    * traverse. The use of a stack is cheaper than allocating the ElInfo objects
    * at every recursive step.
    */
-
   class ElInfoStack
   {
   public:
-    /** \brief
-     * Constructer, creates the stack.
-     */
+    /// Constructer, creates the stack.
     ElInfoStack(Mesh *mesh);
     
-    /** \brief
-     * Destructor, deletes all ElInfos on the stack.
-     */
+    /// Destructor, deletes all ElInfos on the stack.
     ~ElInfoStack();
 
-    /** \brief
-     * Get a new element from the stack an increase the stack position.
-     */
+    /// Get a new element from the stack an increase the stack position.
     ElInfo* getNextElement();
 
-    /** \brief
-     * Decrease the stack position.
-     */
+    /// Decrease the stack position.
     void getBackElement();
 
-    /** \brief
-     * Returns a pointer to the currently used element of the stack.
-     */
+    /// Returns a pointer to the currently used element of the stack.
     ElInfo* getCurrentElement();
 
   protected:
-    /** \brief
-     * The mesh on which the traverse is done.
-     */
+    /// The mesh on which the traverse is done.
     Mesh *mesh_;
 
-    /** \brief
-     * The stack of pointers to ElInfo objects.
-     */
+    /// The stack of pointers to ElInfo objects.
     std::vector<ElInfo*> elInfoStack_;
 
-    /** \brief
-     * Current position (depth) of the recursive mesh traverse.
-     */
+    /// Current position (depth) of the recursive mesh traverse.
     int stackPosition_;
   };
   
 }
 
-
 #endif  // AMDIS_ELINFOSTACK_H
diff --git a/AMDiS/src/GaussElimination.h b/AMDiS/src/GaussElimination.h
deleted file mode 100644
index 49d3b85659a15a8d56c392a017a93e9d130052a3..0000000000000000000000000000000000000000
--- a/AMDiS/src/GaussElimination.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef AMDIS_GAUSSELIMINATION_H
-#define AMDIS_GAUSSELIMINATION_H
-
-#include "DirectSolverInterface.h"
-#include "Global.h"
-#include "MemoryManager.h"
-
-namespace AMDiS
-{
-  template<typename MatrixType, typename VectorType>
-  class GaussElimination : public DirectSolverInterface<MatrixType, VectorType>
-  {
-  public:
-    MEMORY_MANAGED(GaussElimination<MatrixType COMMA VectorType>);
-
-    GaussElimination() {};
-
-    virtual ~GaussElimination() {};
-
-    void solve(MatrixType &a, VectorType &b, VectorType &x, int n) 
-    {
-      FUNCNAME("GaussElimination::solve()");
-
-      int i, j, k, row;
-      double a_ji, max, tmp = 0.0;
-
-      // forward elimination
-      for(i = 0; i < n - 1; i++) {
-
-	// pivoting
-	max = abs(a[i][i]);
-	row = i;
-
-	for(j = i + 1; j < n; j++) {
-	  if(abs(a[j][i]) > max) {
-	    max = abs(a[j][i]);
-	    row = j;
-	  }
-	}
-
-	TEST_EXIT(max > 0.0)("pivoting failed (max entry = 0)\n");
-
-	if(row != i) {
-	  tmp = b[i];
-	  b[i] = b[row];
-	  b[row] = tmp;
-	  for(j = 0;  j < n; j++) {
-	    tmp = a[i][j];
-	    a[i][j] = a[row][j];
-	    a[row][j] = tmp;
-	  }
-	}
-	  
-	// make zeros
-	for(j = i + 1; j < n; j++) {
-	  a_ji = (a[j][i] /= a[i][i]);
-	  for(k = i; k < n; k++) {
-	    a[j][k] -= a_ji * a[i][k];
-	  }
-	  b[j] -= a_ji * b[i];
-	}
-      } 
-
-      // backward elimination
-      for(i = n - 1; i >= 0; i--) {
-	for(j = i + 1; j < n; j++) {
-	  b[i] -= a[i][j] * x[j];
-	}
-	x[i] = b[i] / a[i][i];
-      }
-    };
-  };
-}
-
-#endif
diff --git a/AMDiS/src/Global.h b/AMDiS/src/Global.h
index b3681f9d0b7b2778b19bb1948b26f06f439a3349..406365ae0347cdcc5a1ec1dd5ed59e74a9e1d165 100644
--- a/AMDiS/src/Global.h
+++ b/AMDiS/src/Global.h
@@ -38,10 +38,6 @@
 /** \brief current AMDiS version */
 #define AMDIS_VERSION  "AMDiS: Version 0.100"
 
-// ============================================================================
-// ===== includes =============================================================
-// ============================================================================
-
 #include <string>
 #include <vector>
 #include <fstream>
@@ -51,13 +47,9 @@
 #include <functional>
 #include <float.h>
 
-namespace AMDiS {
-  // ============================================================================
-  // ===== forward declarations =================================================
-  // ============================================================================
+#include "AMDiS_fwd.h"
 
-  class Mesh;
-  class Element;
+namespace AMDiS {
 
   extern const char *funcName;
 
@@ -139,9 +131,6 @@ namespace AMDiS {
 #define DBL_TOL DBL_EPSILON
 #define FLT_TOL FLT_EPSILON
 
-  // ============================================================================
-  // ===== class Msg ============================================================
-  // ============================================================================
 
   /** \brief
    * Manages the output of messages, warnings, errors, ...
@@ -270,8 +259,10 @@ namespace AMDiS {
   /// In debug mode, it corresponds to ERROR_EXIT, otherwise it is noop.
 #if (DEBUG == 0) 
   #define TEST_EXIT_DBG(test) if (false) Msg::catch_error_exit
+  #define DBG_VAR(var)
 #else
 #define TEST_EXIT_DBG(test) if ((test));else ERROR_EXIT
+  #define DBG_VAR(var) var
 #endif
 
   /// prints a message
@@ -337,9 +328,6 @@ namespace AMDiS {
 #define MAXPART FACE
 #define MINPART PROJECTION
 
-  // ============================================================================
-  // ===== class Global =========================================================
-  // ============================================================================
 
   /** \ingroup Common
    * \brief
@@ -359,9 +347,7 @@ namespace AMDiS {
       return referenceElement[dim];
     }
 
-    /** \brief
-     * returns geometrical information. Currently this is only dimOfWorld.
-     */
+    /// returns geometrical information. Currently this is only dimOfWorld.
     static inline int getGeo(GeoIndex p) {
       if (WORLD == p) 
 	return dimOfWorld; 
diff --git a/AMDiS/src/GlobalDOFNumbering.h b/AMDiS/src/GlobalDOFNumbering.h
index ed3cbb633f840751b103409f426751deb9791024..dede578d78094e5ad413632f737b6c4d0f78384a 100644
--- a/AMDiS/src/GlobalDOFNumbering.h
+++ b/AMDiS/src/GlobalDOFNumbering.h
@@ -22,24 +22,13 @@
 #ifndef AMDIS_GLOBALDOFNUMBERING_H
 #define AMDIS_GLOBALDOFNUMBERING_H
 
-// ===========================================================================
-// ===== includes ============================================================
-// ===========================================================================
 #include <map>
 #include <vector>
 #include "Global.h"
+#include "AMDiS_fwd.h"
 
 namespace AMDiS {
 
-  // =========================================================================
-  // ===== forward declarations ==============================================
-  // =========================================================================
-  class MeshStructure;
-
-  // =========================================================================
-  // ===== class GlobalDOFNumbering ======================================
-  // =========================================================================
-
   /** \ingroup Parallel
    * \brief 
    * Creates a global DOF numbering.
@@ -47,21 +36,15 @@ namespace AMDiS {
   class GlobalDOFNumbering
   {
   public:
-    /** \brief
-     * Constructor
-     */
+    /// Constructor
     GlobalDOFNumbering(std::vector<MeshStructure*> &meshCodes,
 		       std::vector< std::vector<DegreeOfFreedom> > &dofCodes,
 		       int dofsPerElement);
 
-    /** \brief
-     * Returns the local index of rank corresponding to global index.
-     */
+    /// Returns the local index of rank corresponding to global index.
     int getLocalIndex(int rank, int globalIndex);
 
-    /** \brief
-     * Returns the global index corresponing to local index of rank.
-     */
+    /// Returns the global index corresponing to local index of rank.
     int getGlobalIndex(int rank, int localIndex);
 
   protected:
diff --git a/AMDiS/src/GlobalElementNumbering.h b/AMDiS/src/GlobalElementNumbering.h
index 800d47686b391cde69f1511c37767b3c2439bdf4..c2e9a280bca2486aecd918eb19ae7d3a1f86f7c5 100644
--- a/AMDiS/src/GlobalElementNumbering.h
+++ b/AMDiS/src/GlobalElementNumbering.h
@@ -22,23 +22,11 @@
 #ifndef AMDIS_GLOBALELEMENTNUMBERING_H
 #define AMDIS_GLOBALELEMENTNUMBERING_H
 
-// ===========================================================================
-// ===== includes ============================================================
-// ===========================================================================
 #include <map>
+#include "AMDiS_fwd.h"
 
 namespace AMDiS {
 
-  // =========================================================================
-  // ===== forward declarations ==============================================
-  // =========================================================================
-  class MeshStructure;
-  class Mesh;
-
-  // =========================================================================
-  // ===== class GlobalElementNumbering ======================================
-  // =========================================================================
-
   /** \ingroup Parallel
    * \brief 
    * Creates a global element numbering.
@@ -46,31 +34,21 @@ namespace AMDiS {
   class GlobalElementNumbering
   {
   public:
-    /** \brief
-     * Constructor
-     */
+    /// Constructor
     GlobalElementNumbering(MeshStructure *compositeStructure,
 			   Mesh *localMesh);
 
-    /** \brief
-     * Returns the local index corresponding to local index.
-     */
+    /// Returns the local index corresponding to local index.
     int getLocalIndex(int globalIndex);
 
-    /** \brief
-     * Returns the global index corresponing to local index.
-     */
+    /// Returns the global index corresponing to local index.
     int getGlobalIndex(int localIndex);
 
   protected:
-    /** \brief
-     * Maps each local index to its global index.
-     */
+    /// Maps each local index to its global index.
     std::map<int, int> localToGlobal_;
 
-    /** \brief
-     * Stores local index for each global index.
-     */
+    /// Stores local index for each global index.
     std::map<int, int> globalToLocal_;
   };
 
diff --git a/AMDiS/src/LeafData.cc b/AMDiS/src/LeafData.cc
index 4a78281eda2f717a331744fb4198684066d92a55..f29d3e7fc93e2f806b94e38f4b029a7e186e25bc 100644
--- a/AMDiS/src/LeafData.cc
+++ b/AMDiS/src/LeafData.cc
@@ -61,7 +61,7 @@ namespace AMDiS {
 						  int elTypeParent)
  
   {
-    bool test = otherChild->deleteElementData(ESTIMATABLE);
+    DBG_VAR(bool test =) otherChild->deleteElementData(ESTIMATABLE);
     TEST_EXIT_DBG(test)("couldn't delete LeafDataEstimatableVec at otherChild");
     parent->setElementData(NEW LeafDataEstimatableVec(parent->getElementData()));
     ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent);
@@ -83,7 +83,7 @@ namespace AMDiS {
 					       Element* otherChild,
 					       int elTypeParent)
   {
-    bool test = otherChild->deleteElementData(COARSENABLE);
+    DBG_VAR(bool test =) otherChild->deleteElementData(COARSENABLE);
     TEST_EXIT_DBG(test)("couldn't delete LeafDataCoarsenable at otherChild");
 
     parent->setElementData(NEW LeafDataCoarsenable(parent->getElementData()));
@@ -106,7 +106,7 @@ namespace AMDiS {
 						  Element* otherChild,
 						  int elTypeParent) 
   {
-    bool test = otherChild->deleteElementData(COARSENABLE);
+    DBG_VAR(bool test =) otherChild->deleteElementData(COARSENABLE);
     TEST_EXIT_DBG(test)("couldn't delete LeafDataCoarsenableVec at otherChild");
     parent->setElementData(NEW LeafDataCoarsenableVec(parent->getElementData()));
     ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent);
diff --git a/AMDiS/src/Parametric.h b/AMDiS/src/Parametric.h
index 9b1356895775b49f98a2f6deb9d1b6bee716d4db..34de0f9ea220ba208428f7e19a22c34256cc9bb2 100644
--- a/AMDiS/src/Parametric.h
+++ b/AMDiS/src/Parametric.h
@@ -23,21 +23,10 @@
 #define AMDIS_PARAMETRIC_H
 
 #include "MemoryManager.h"
+#include "AMDiS_fwd.h"
 
 namespace AMDiS {
 
-  // ============================================================================
-  // ===== forward declarations =================================================
-  // ============================================================================
-
-  class ElInfo;
-  template<typename T> class DOFVector;
-  template<typename T> class WorldVector;
-
-  // ============================================================================
-  // ===== class Parametric =====================================================
-  // ============================================================================
-
   /** \brief
    * Interface for parametric elements. A Parametric object can be given to
    * a Mesh. 
@@ -45,7 +34,7 @@ namespace AMDiS {
    */
   class Parametric {
   public:
-    virtual ~Parametric() {};
+    virtual ~Parametric() {}
 
     /** \brief
      * Can return a pointer to a new parametric ElInfo or the original pointer 
@@ -74,39 +63,25 @@ namespace AMDiS {
     virtual ElInfo *removeParametricInfo(ElInfo *elInfo) = 0;
   };
 
-  // ============================================================================
-  // ===== class ParametricFirstOrder ===========================================
-  // ============================================================================
-
-  /** \brief
-   * Implementation of linear parametric elements.
-   */
+  /// Implementation of linear parametric elements.
   class ParametricFirstOrder : public Parametric
   {
   public:
     MEMORY_MANAGED(ParametricFirstOrder);
 
-    /** \brief
-     * Constructor. \ref dofCoords are set to coords.
-     */
+    /// Constructor. \ref dofCoords are set to coords.
     ParametricFirstOrder(WorldVector<DOFVector<double>*> *coords)
       : dofCoords_(coords)
-    {};
+    {}
 
-    /** \brief
-     * Implementation of \ref Parametric::addParametricInfo().
-     */
+    /// Implementation of \ref Parametric::addParametricInfo().
     ElInfo *addParametricInfo(ElInfo *elInfo);
 
-    /** \brief
-     * Implementation of \ref Parametric::removeParametricInfo().
-     */
+    /// Implementation of \ref Parametric::removeParametricInfo().
     ElInfo *removeParametricInfo(ElInfo *elInfo);
 
   protected:
-    /** \brief
-     * Pointer to a DOFVector of world coordinates.
-     */
+    /// Pointer to a DOFVector of world coordinates.
     WorldVector<DOFVector<double>*> *dofCoords_;
   };
 
diff --git a/AMDiS/src/ProblemScal.cc b/AMDiS/src/ProblemScal.cc
index cd9cf55b677731f2e3731930ccda9d1e2499e144..bfacb520d05c5b428bc53fca11242909a8e5ce56 100644
--- a/AMDiS/src/ProblemScal.cc
+++ b/AMDiS/src/ProblemScal.cc
@@ -142,7 +142,7 @@ namespace AMDiS {
       rhs->getBoundaryManager()->addBoundaryCondition(periodic);
   }
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
   void ProblemScal::useApplicationOrdering(AO *ao) 
   {
     applicationOrdering = ao;
@@ -538,7 +538,7 @@ namespace AMDiS {
 
     clock_t first = clock();
 
-#ifndef HAVE_PARALLEL_AMDIS
+#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
     mesh->dofCompress();
 #endif
 
@@ -617,7 +617,7 @@ namespace AMDiS {
 
     INFO(info, 8)("buildAfterCoarsen needed %.5f seconds\n", TIME_USED(first,clock()));
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
 //     PetscErrorCode ierr;
 //     Mat A;
 
diff --git a/AMDiS/src/ProblemScal.h b/AMDiS/src/ProblemScal.h
index 87d54dd9bd3fd637d0537b9853c8f299411c8ff5..c4231babd29b9aa361ab7457249ba93f300f0f06 100644
--- a/AMDiS/src/ProblemScal.h
+++ b/AMDiS/src/ProblemScal.h
@@ -33,7 +33,7 @@
 #include "Boundary.h"
 #include "StandardProblemIteration.h"
 
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
 #include "petscao.h"
 #endif
 
@@ -62,7 +62,7 @@ namespace AMDiS {
 	useGetBound(true),
 	refinementManager(NULL),
 	coarseningManager(NULL),
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
         applicationOrdering(NULL),
 #endif
 	info(10)
@@ -207,7 +207,7 @@ namespace AMDiS {
     /// Adds periodic boundary conditions.
     virtual void addPeriodicBC(BoundaryType type);
     
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     /// Sets the petsc application ordering object to map dof indices.
     void useApplicationOrdering(AO *ao);
 #endif
@@ -371,7 +371,7 @@ namespace AMDiS {
      */
     CoarseningManager *coarseningManager;
   
-#ifdef HAVE_PARALLEL_AMDIS
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
     /// Petsc application ordering to map dof indices.
     AO *applicationOrdering;
 #endif
diff --git a/AMDiS/src/Recovery.cc b/AMDiS/src/Recovery.cc
index bfe4a3e7b6358273951249b7fe66c55d36c89e4b..e7c6af1bf5be75392e03b3f2a09a015b0c0bf4d6 100644
--- a/AMDiS/src/Recovery.cc
+++ b/AMDiS/src/Recovery.cc
@@ -914,9 +914,10 @@ Recovery::recovery(DOFVector<double> *uh, const FiniteElemSpace *fe_space,
   // Solving local systems.
   for (SV_it.reset(); !SV_it.end(); ++SV_it) {
     if ((*SV_it).A) {
-      int error = Cholesky::solve((*SV_it).A, 
-				  (*SV_it).rec_grdUh,
-				  (*SV_it).rec_grdUh);
+      DBG_VAR(int error =)
+	Cholesky::solve((*SV_it).A, 
+			(*SV_it).rec_grdUh,
+			(*SV_it).rec_grdUh);
       TEST_EXIT_DBG(error)
 	("There must be some error, matrix is not positive definite.\n");
     }
@@ -932,9 +933,8 @@ Recovery::recovery(DOFVector<double> *uh, const FiniteElemSpace *fe_space,
     vec = NULL;
   }
   
-  if (!vec) {
+  if (!vec)
     vec = NEW DOFVector<WorldVector<double> >(feSpace, "gradient");
-  }
 
   result = vec;