Index: src/Actions/FillAction/FillRegularGridAction.cpp
===================================================================
--- src/Actions/FillAction/FillRegularGridAction.cpp	(revision a090e3bbbb29271069f6efbe5ae41f0b9d0dcd57)
+++ src/Actions/FillAction/FillRegularGridAction.cpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
@@ -44,21 +44,9 @@
 #include "Filling/Cluster.hpp"
 #include "Filling/Filler.hpp"
-#include "Filling/Inserter/Inserter.hpp"
-#include "Filling/Inserter/RandomInserter.hpp"
-#include "Filling/Mesh/CubeMesh.hpp"
-#include "Filling/Predicates/IsInsideSurface_FillPredicate.hpp"
-#include "Filling/Predicates/IsVoidNode_FillPredicate.hpp"
-#include "Filling/Predicates/Ops_FillPredicate.hpp"
-#include "LinkedCell/linkedcell.hpp"
-#include "LinkedCell/PointCloudAdaptor.hpp"
+#include "Filling/Preparators/BoxFillerPreparator.hpp"
 #include "molecule.hpp"
 #include "MoleculeListClass.hpp"
 #include "Parser/FormatParserInterface.hpp"
 #include "Parser/FormatParserStorage.hpp"
-#include "Shapes/BaseShapes.hpp"
-#include "Tesselation/tesselation.hpp"
-#include "Tesselation/BoundaryLineSet.hpp"
-#include "Tesselation/BoundaryTriangleSet.hpp"
-#include "Tesselation/CandidateForTesselation.hpp"
 #include "World.hpp"
 
@@ -94,99 +82,75 @@
   filler->CenterEdge();
 
-  // check for selected atoms and create surfaces from them
-  std::vector<atom *> atoms(World::getInstance().getSelectedAtoms());
-  FillPredicate * surface_predicate = NULL;
-  LinkedCell_deprecated * LC = NULL;
-  Tesselation * TesselStruct = NULL;
+  // prepare the filler preparator
+  BoxFillerPreparator filler_preparator(filler);
   if (params.SphereRadius.get() != 0.) {
-    if ( atoms.size() == 0) {
+    if (World::getInstance().beginAtomSelection() == World::getInstance().endAtomSelection()) {
       STATUS("You have given a sphere radius "+toString(params.SphereRadius.get())
           +" != 0, but have not select any atoms.");
       return Action::failure;
     }
-    // create adaptor for the selected atoms
-    PointCloudAdaptor< std::vector<atom *> > cloud(&atoms, std::string("Selected atoms"));
-
-    // create tesselation
-    LC = new LinkedCell_deprecated(cloud, 2.*params.SphereRadius.get());
-    TesselStruct = new Tesselation;
-    (*TesselStruct)(cloud, params.SphereRadius.get());
-
-    // and create predicate
-    surface_predicate = new FillPredicate( IsInsideSurface_FillPredicate( *TesselStruct, *LC ) );
-  }
-
-  // create predicate, mesh, and filler
+    std::vector<atom*> atoms(World::getInstance().getSelectedAtoms());
+    filler_preparator.addSurfacePredicate(
+        params.SphereRadius.get(),
+        atoms);
+  }
+  filler_preparator.addVoidPredicate(params.mindistance.get());
+  filler_preparator.addRandomInserter(
+      params.RandAtomDisplacement.get(),
+      params.RandMoleculeDisplacement.get(),
+      params.DoRotate.get());
+  filler_preparator.addCubeMesh(
+      params.counts.get(),
+      params.offset.get(),
+      World::getInstance().getDomain().getM());
+  if (!filler_preparator()) {
+    STATUS("Filler was not fully constructed.");
+    return Action::failure;
+  }
+
+  // use filler
+  bool successflag = false;
   FillRegularGridState *UndoState = NULL;
-  bool successflag = false;
   {
-    FillPredicate *voidnode_predicate = new FillPredicate(
-        IsVoidNode_FillPredicate(
-            Sphere(zeroVec, params.mindistance.get())
-            )
-        );
-    FillPredicate Andpredicate = (*voidnode_predicate);
-    if (surface_predicate != NULL)
-      Andpredicate = (Andpredicate) && !(*surface_predicate);
-    Mesh *mesh = new CubeMesh(params.counts.get(), params.offset.get(), World::getInstance().getDomain().getM());
-    Inserter *inserter = new Inserter(
-        Inserter::impl_ptr(
-            new RandomInserter(
-                params.RandAtomDisplacement.get(),
-                params.RandMoleculeDisplacement.get(),
-                params.DoRotate.get())
-            )
-        );
-
     // fill
-    {
-      Filler *fillerFunction = new Filler(*mesh, Andpredicate, *inserter);
-      // TODO: When molecule::getBoundingSphere() does not use a sphere anymore,
-      // we need to check whether we rotate the molecule randomly. For this to
-      // work we need a sphere!
-      const Shape s = filler->getBoundingSphere(params.RandAtomDisplacement.get());
-      ClusterInterface::Cluster_impl cluster( new Cluster(filler->getAtomIds(), s) );
-      CopyAtoms_withBonds copyMethod;
-      Filler::ClusterVector_t ClonedClusters;
-      successflag = (*fillerFunction)(copyMethod, cluster, ClonedClusters);
-      delete fillerFunction;
-
-      // append each cluster's atoms to clonedatoms (however not selected ones)
-      std::vector<const atom *> clonedatoms;
-      std::vector<AtomicInfo> clonedatominfos;
-      for (Filler::ClusterVector_t::const_iterator iter = ClonedClusters.begin();
-          iter != ClonedClusters.end(); ++iter) {
-        const AtomIdSet &atoms = (*iter)->getAtomIds();
-        clonedatoms.reserve(clonedatoms.size()+atoms.size());
-        for (AtomIdSet::const_iterator atomiter = atoms.begin(); atomiter != atoms.end(); ++atomiter)
-          if (!filler->containsAtom(*atomiter)) {
-            clonedatoms.push_back( *atomiter );
-            clonedatominfos.push_back( AtomicInfo(*(*atomiter)) );
-          }
-      }
-      std::vector< BondInfo > clonedbonds;
-      StoreBondInformationFromAtoms(clonedatoms, clonedbonds);
-      LOG(2, "DEBUG: There are " << clonedatominfos.size() << " newly created atoms.");
-
-      if (!successflag) {
-        STATUS("Insertion failed, removing inserted clusters, translating original one back");
-        RemoveAtomsFromAtomicInfo(clonedatominfos);
-        clonedatoms.clear();
-        SetAtomsFromAtomicInfo(movedatoms);
-      } else {
-        std::vector<Vector> MovedToVector(filler->size(), zeroVec);
-        std::transform(filler->begin(), filler->end(), MovedToVector.begin(),
-            boost::bind(&AtomInfo::getPosition, _1) );
-        UndoState = new FillRegularGridState(clonedatominfos,clonedbonds,movedatoms,MovedToVector,params);
-      }
+    Filler *fillerFunction = filler_preparator.obtainFiller();
+    // TODO: When molecule::getBoundingSphere() does not use a sphere anymore,
+    // we need to check whether we rotate the molecule randomly. For this to
+    // work we need a sphere!
+    const Shape s = filler->getBoundingSphere(params.RandAtomDisplacement.get());
+    ClusterInterface::Cluster_impl cluster( new Cluster(filler->getAtomIds(), s) );
+    CopyAtoms_withBonds copyMethod;
+    Filler::ClusterVector_t ClonedClusters;
+    successflag = (*fillerFunction)(copyMethod, cluster, ClonedClusters);
+    delete fillerFunction;
+
+    // append each cluster's atoms to clonedatoms (however not selected ones)
+    std::vector<const atom *> clonedatoms;
+    std::vector<AtomicInfo> clonedatominfos;
+    for (Filler::ClusterVector_t::const_iterator iter = ClonedClusters.begin();
+        iter != ClonedClusters.end(); ++iter) {
+      const AtomIdSet &atoms = (*iter)->getAtomIds();
+      clonedatoms.reserve(clonedatoms.size()+atoms.size());
+      for (AtomIdSet::const_iterator atomiter = atoms.begin(); atomiter != atoms.end(); ++atomiter)
+        if (!filler->containsAtom(*atomiter)) {
+          clonedatoms.push_back( *atomiter );
+          clonedatominfos.push_back( AtomicInfo(*(*atomiter)) );
+        }
     }
-
-    // remove
-    delete mesh;
-    delete inserter;
-    delete voidnode_predicate;
-    delete surface_predicate;
-    delete LC;
-    delete TesselStruct;
+    std::vector< BondInfo > clonedbonds;
+    StoreBondInformationFromAtoms(clonedatoms, clonedbonds);
+    LOG(2, "DEBUG: There are " << clonedatominfos.size() << " newly created atoms.");
+
+    if (!successflag) {
+      STATUS("Insertion failed, removing inserted clusters, translating original one back");
+      RemoveAtomsFromAtomicInfo(clonedatominfos);
+      clonedatoms.clear();
+      SetAtomsFromAtomicInfo(movedatoms);
+    } else {
+      std::vector<Vector> MovedToVector(filler->size(), zeroVec);
+      std::transform(filler->begin(), filler->end(), MovedToVector.begin(),
+          boost::bind(&AtomInfo::getPosition, _1) );
+      UndoState = new FillRegularGridState(clonedatominfos,clonedbonds,movedatoms,MovedToVector,params);
+    }
   }
 
Index: src/Filling/Makefile.am
===================================================================
--- src/Filling/Makefile.am	(revision a090e3bbbb29271069f6efbe5ae41f0b9d0dcd57)
+++ src/Filling/Makefile.am	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
@@ -19,5 +19,7 @@
 	Filling/Predicates/IsValidInDomain_FillPredicate.cpp \
 	Filling/Predicates/IsVoidNode_FillPredicate.cpp \
-	Filling/Predicates/Ops_FillPredicate.cpp
+	Filling/Predicates/Ops_FillPredicate.cpp \
+	Filling/Preparators/BaseFillerPreparator.cpp \
+	Filling/Preparators/BoxFillerPreparator.cpp
 	
 FILLINGHEADER = \
@@ -44,6 +46,7 @@
 	Filling/Predicates/IsVoidNode_FillPredicate.hpp \
 	Filling/Predicates/Ops_FillPredicate.hpp \
-	Filling/Predicates/Ops_FillPredicate_impl.hpp
-				  
+	Filling/Predicates/Ops_FillPredicate_impl.hpp \
+	Filling/Preparators/BaseFillerPreparator.hpp \
+	Filling/Preparators/BoxFillerPreparator.hpp
 
 noinst_LTLIBRARIES += libMolecuilderFilling.la
Index: src/Filling/Preparators/BaseFillerPreparator.cpp
===================================================================
--- src/Filling/Preparators/BaseFillerPreparator.cpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
+++ src/Filling/Preparators/BaseFillerPreparator.cpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
@@ -0,0 +1,140 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ *
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder 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.
+ *
+ *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * BaseFillerPreparator.cpp
+ *
+ *  Created on: Sep 2, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "BaseFillerPreparator.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include "Atom/atom.hpp"
+#include "Filling/Cluster.hpp"
+#include "Filling/Filler.hpp"
+#include "Filling/Inserter/Inserter.hpp"
+#include "Filling/Inserter/RandomInserter.hpp"
+#include "Filling/Mesh/CubeMesh.hpp"
+#include "Filling/Mesh/MeshAdaptor.hpp"
+#include "Filling/Predicates/IsInsideSurface_FillPredicate.hpp"
+#include "Filling/Predicates/IsVoidNode_FillPredicate.hpp"
+#include "Filling/Predicates/Ops_FillPredicate.hpp"
+#include "LinkedCell/linkedcell.hpp"
+#include "LinkedCell/PointCloudAdaptor.hpp"
+#include "molecule.hpp"
+#include "Shapes/BaseShapes.hpp"
+#include "Tesselation/tesselation.hpp"
+
+
+BaseFillerPreparator::BaseFillerPreparator(molecule *_filler) :
+  filler(_filler),
+  surface_predicate(NULL),
+  LC(NULL),
+  TesselStruct(NULL),
+  voidnode_predicate(NULL),
+  Andpredicate(NULL),
+  mesh(NULL),
+  inserter(NULL),
+  fillerFunction(NULL)
+{}
+
+BaseFillerPreparator::~BaseFillerPreparator()
+{
+  // free all structures if allocated
+  delete fillerFunction;
+  delete inserter;
+  delete mesh;
+  delete Andpredicate;
+  delete voidnode_predicate;
+  delete TesselStruct;
+  delete LC;
+  delete surface_predicate;
+  // given filler molecule is from someplace else
+  filler = NULL;
+}
+
+void BaseFillerPreparator::addSurfacePredicate(
+    const double _radius,
+    std::vector<atom *> &_atoms)
+{
+  // create adaptor for the selected atoms
+  PointCloudAdaptor< std::vector<atom *> > cloud(&_atoms, std::string("Selected atoms"));
+
+  // create tesselation
+  LC = new LinkedCell_deprecated(cloud, 2.*_radius);
+  TesselStruct = new Tesselation;
+  (*TesselStruct)(cloud, _radius);
+
+  // and create predicate
+  surface_predicate = new FillPredicate( IsInsideSurface_FillPredicate( *TesselStruct, *LC ) );
+}
+
+void BaseFillerPreparator::addRandomInserter(
+    const double _RandAtomDisplacement,
+    const double _RandMoleculeDisplacement,
+    const bool _DoRotate)
+{
+  inserter = new Inserter(
+      Inserter::impl_ptr(
+          new RandomInserter(
+              _RandAtomDisplacement,
+              _RandMoleculeDisplacement,
+              _DoRotate)
+          )
+      );
+}
+
+void BaseFillerPreparator::addVoidPredicate(
+    const double _mindistance)
+{
+  voidnode_predicate = new FillPredicate(
+      IsVoidNode_FillPredicate(
+          Sphere(zeroVec, _mindistance)
+          )
+      );
+}
+
+bool BaseFillerPreparator::operator()()
+{
+  if ((mesh != NULL)
+      && (inserter != NULL)
+      && (voidnode_predicate != NULL)) {
+
+    FillPredicate Andpredicate = *voidnode_predicate;
+    if (surface_predicate != NULL)
+      Andpredicate = (Andpredicate) && !(*surface_predicate);
+    fillerFunction = new Filler(*mesh, Andpredicate, *inserter);
+    return true;
+  } else {
+    return false;
+  }
+}
Index: src/Filling/Preparators/BaseFillerPreparator.hpp
===================================================================
--- src/Filling/Preparators/BaseFillerPreparator.hpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
+++ src/Filling/Preparators/BaseFillerPreparator.hpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
@@ -0,0 +1,75 @@
+/*
+ * BaseFillerPrepator.hpp
+ *
+ *  Created on: Sep 2, 2014
+ *      Author: heber
+ */
+
+#ifndef BASEFILLERPREPARATOR_HPP_
+#define BASEFILLERPREPARATOR_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+class atom;
+class Filler;
+class FillPredicate;
+class Inserter;
+class LinkedCell_deprecated;
+class Mesh;
+class molecule;
+class Tesselation;
+
+#include <vector>
+
+/** BaseFillerPrepator is the base class for all specific filler preparators.
+ *
+ * Specific preparators combine all the various aspects of filling into a specific
+ * package for easy and convenient calling for returning a filler function.
+ *
+ * It defines both the interface and implements some common functions.
+ */
+class BaseFillerPreparator
+{
+public:
+  BaseFillerPreparator(molecule *_filler);
+  virtual ~BaseFillerPreparator();
+
+  void addSurfacePredicate(
+      const double _radius,
+      std::vector<atom *> &_atoms);
+  void addRandomInserter(
+      const double _RandAtomDisplacement,
+      const double _RandMoleculeDisplacement,
+      const bool _DoRotate);
+  void addVoidPredicate(
+      const double _mindistance);
+  bool operator()();
+
+  /* The operator is just a getter for the constructed fillerFunction.
+   *
+   * \return allocated Filler (is not deleted here)
+   */
+  Filler* obtainFiller()
+  {
+    Filler *temp = fillerFunction;
+    fillerFunction = NULL;
+    return temp;
+  }
+
+protected:
+  molecule *filler;
+  FillPredicate * surface_predicate;
+  LinkedCell_deprecated * LC;
+  Tesselation * TesselStruct;
+  FillPredicate *voidnode_predicate;
+  FillPredicate *Andpredicate;
+  Mesh *mesh;
+  Inserter *inserter;
+  Filler *fillerFunction;
+};
+
+
+#endif /* BASEFILLERPREPARATOR_HPP_ */
Index: src/Filling/Preparators/BoxFillerPreparator.cpp
===================================================================
--- src/Filling/Preparators/BoxFillerPreparator.cpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
+++ src/Filling/Preparators/BoxFillerPreparator.cpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
@@ -0,0 +1,57 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ *
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder 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.
+ *
+ *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * BoxFillerPreparator.cpp
+ *
+ *  Created on: Sep 2, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "BoxFillerPreparator.hpp"
+
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
+
+#include "Filling/Mesh/CubeMesh.hpp"
+#include "molecule.hpp"
+
+BoxFillerPreparator::BoxFillerPreparator(molecule *_filler) :
+  BaseFillerPreparator(_filler)
+{}
+
+BoxFillerPreparator::~BoxFillerPreparator()
+{}
+
+void BoxFillerPreparator::addCubeMesh(
+    const std::vector<unsigned int> _counts,
+    const Vector &_offset,
+    const RealSpaceMatrix &_M)
+{
+  mesh = new CubeMesh(_counts, _offset, _M);
+}
Index: src/Filling/Preparators/BoxFillerPreparator.hpp
===================================================================
--- src/Filling/Preparators/BoxFillerPreparator.hpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
+++ src/Filling/Preparators/BoxFillerPreparator.hpp	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
@@ -0,0 +1,42 @@
+/*
+ * BoxFillerPreparator.hpp
+ *
+ *  Created on: Sep 2, 2014
+ *      Author: heber
+ */
+
+#ifndef BOXFILLERPREPARATOR_HPP_
+#define BOXFILLERPREPARATOR_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "BaseFillerPreparator.hpp"
+
+#include <vector>
+
+#include "LinearAlgebra/Vector.hpp"
+
+class RealSpaceMatrix;
+
+/** This class prepares a filler for filling the whole domain at specific points.
+ *
+ */
+class BoxFillerPreparator :
+  public BaseFillerPreparator
+{
+public:
+    BoxFillerPreparator(molecule *_filler);
+    ~BoxFillerPreparator();
+
+    void addCubeMesh(
+        const std::vector<unsigned int> _counts,
+        const Vector &_offset,
+        const RealSpaceMatrix &_M);
+
+};
+
+
+#endif /* BOXFILLERPREPARATOR_HPP_ */
Index: src/documentation/constructs/filling.dox
===================================================================
--- src/documentation/constructs/filling.dox	(revision a090e3bbbb29271069f6efbe5ae41f0b9d0dcd57)
+++ src/documentation/constructs/filling.dox	(revision cae61447a8c102b09ec82b970c3991c54f311fb5)
@@ -74,5 +74,17 @@
  * the specific implementations of the class \ref Inserter.
  *
+ * \section filling-preparators Filling Preparators
  *
- * \date 2014-03-10
+ * The filling function depends on quite a number of other instances. In order
+ * to make this a little easier to use, there are so called FillerPreparators
+ * for various purposes:
+ * -# BoxFillerPreparator - fills the simulation domain
+ * -# ShapeSurfaceFillerPreparator - fills on the surface of a selected shape
+ * -# ShapeVolumeFillerPreparator - fills the volume of a selected shape
+ *
+ * These offer various functions to easily install an Inserter, a Mesh, and
+ * necessary FillPredicates. See the Filling Actions such as 
+ * MoleCuilder::FillVolumeAction as example.
+ *
+ * \date 2014-09-04
  */
