Index: src/Atom/AtomObserver.cpp
===================================================================
--- src/Atom/AtomObserver.cpp	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/Atom/AtomObserver.cpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -36,79 +36,27 @@
 #include "CodePatterns/MemDebug.hpp"
 
-#include "AtomObserver.hpp"
+#include <boost/assign.hpp>
 
 #include "CodePatterns/Singleton_impl.hpp"
 
-#include "Atom/atom.hpp"
 #include "Atom/atom_observable.hpp"
 
+#include "AtomObserver.hpp"
 
-/** Private constructor of class AtomObserver.
- *
- */
-AtomObserver::AtomObserver() :
-  Relay(std::string("AtomObserver"))
+using namespace boost::assign;
+
+static const Observable::channels_t getAtomChannels()
 {
-  Channels *OurChannel = new Channels();
-  Observable::insertNotificationChannel( std::make_pair(static_cast<Observable *>(this), OurChannel) );
-  OurChannel->addChannel(AtomObservable::PositionChanged);
-  OurChannel->addChannel(AtomObservable::VelocityChanged);
-  OurChannel->addChannel(AtomObservable::ForceChanged);
-  OurChannel->addChannel(AtomObservable::MoleculeChanged);
-  OurChannel->addChannel(AtomObservable::NameChanged);
-  OurChannel->addChannel(AtomObservable::ElementChanged);
-  OurChannel->addChannel(AtomObservable::IndexChanged);
-  OurChannel->addChannel(AtomObservable::PropertyChanged);
-  OurChannel->addChannel(AtomObservable::BondsAdded);
-  OurChannel->addChannel(AtomObservable::BondsRemoved);
-  OurChannel->addChannel(AtomObservable::TrajectoryChanged);
-  OurChannel->addChannel(AtomObservable::SelectionChanged);
+  Observable::channels_t channels;
+  for (int i=0;i<AtomObservable::NotificationType_MAX; ++i)
+    channels += (enum AtomObservable::NotificationType)i;
+  return channels;
 }
 
-/** Private Destructor of class AtomObserver.
- *
- */
-AtomObserver::~AtomObserver()
+const Observable::channels_t AtomObserver::AtomChannels(getAtomChannels());
+
+AtomObserver::AtomObserver() :
+    EntityObserver<atom>(AtomChannels, std::string("AtomObserver"))
 {}
 
-/** Function to call when a new atom has been created.
- *
- * @param res
- */
-void AtomObserver::AtomInserted(atom *res)
-{
-  res->signOn(this, AtomObservable::PositionChanged);
-  res->signOn(this, AtomObservable::VelocityChanged);
-  res->signOn(this, AtomObservable::ForceChanged);
-  res->signOn(this, AtomObservable::MoleculeChanged);
-  res->signOn(this, AtomObservable::NameChanged);
-  res->signOn(this, AtomObservable::ElementChanged);
-  res->signOn(this, AtomObservable::IndexChanged);
-  res->signOn(this, AtomObservable::PropertyChanged);
-  res->signOn(this, AtomObservable::BondsAdded);
-  res->signOn(this, AtomObservable::BondsRemoved);
-  res->signOn(this, AtomObservable::TrajectoryChanged);
-  res->signOn(this, AtomObservable::SelectionChanged);
-}
-
-/** Function to call when an atom is about to get deleted.
- *
- * @param res
- */
-void AtomObserver::AtomRemoved(atom *res)
-{
-  res->signOff(this, AtomObservable::PositionChanged);
-  res->signOff(this, AtomObservable::VelocityChanged);
-  res->signOff(this, AtomObservable::ForceChanged);
-  res->signOff(this, AtomObservable::MoleculeChanged);
-  res->signOff(this, AtomObservable::NameChanged);
-  res->signOff(this, AtomObservable::ElementChanged);
-  res->signOff(this, AtomObservable::IndexChanged);
-  res->signOff(this, AtomObservable::PropertyChanged);
-  res->signOff(this, AtomObservable::BondsAdded);
-  res->signOff(this, AtomObservable::BondsRemoved);
-  res->signOff(this, AtomObservable::TrajectoryChanged);
-  res->signOff(this, AtomObservable::SelectionChanged);
-}
-
 CONSTRUCT_SINGLETON(AtomObserver)
Index: src/Atom/AtomObserver.hpp
===================================================================
--- src/Atom/AtomObserver.hpp	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/Atom/AtomObserver.hpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -14,6 +14,7 @@
 #endif
 
-#include "CodePatterns/Observer/Relay.hpp"
 #include "CodePatterns/Singleton.hpp"
+
+#include "EntityObserver.hpp"
 
 class atom;
@@ -21,30 +22,18 @@
 /** The AtomObserver is a central instance to all changes occuring within atoms.
  *
- * The intent is that if a class wants to know about changes in just _any_ atom,
- * he may register singly to this class and not to each and every atom. This also
- * keeps him updated in case of removed or added atoms.
- *
- * \warning AtomObserver must get purged \b after World as we do not keep an
- * an internal list of all atoms. Hence, each atom must get destroyed while
- * the AtomObserver instance is still intact or segfault will occur.
+ * It implements the templated EntityObserver class for atoms.
  *
  * \sa MoleculeObserver
  */
-class AtomObserver : public Singleton<AtomObserver>, public Relay
+class AtomObserver : public Singleton< AtomObserver >, public EntityObserver<atom>
 {
   //!> grant Singleton access to cstor and dstor.
-  friend class Singleton<AtomObserver>;
+  friend class Singleton< AtomObserver >;
 
-  //!> grant atom access
-  friend class atom;
-public:
-
-private:
-  void AtomInserted(atom *res);
-  void AtomRemoved(atom *res);
+  //!> list of all observed channels
+  static const Observable::channels_t AtomChannels;
 
   // private constructor and destructor due to singleton
   AtomObserver();
-  virtual ~AtomObserver();
 };
 
Index: src/Atom/atom.cpp
===================================================================
--- src/Atom/atom.cpp	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/Atom/atom.cpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -60,5 +60,5 @@
 {
   // note AtomObserver about inserted atom
-  AtomObserver::getInstance().AtomInserted(this);
+  AtomObserver::getInstance().Inserted(this);
 }
 
@@ -75,5 +75,5 @@
 
   // note AtomObserver about inserted atom
-  AtomObserver::getInstance().AtomInserted(this);
+  AtomObserver::getInstance().Inserted(this);
 };
 
@@ -95,5 +95,5 @@
   removeFromMolecule();
   // note AtomObserver about removed atom
-  AtomObserver::getInstance().AtomRemoved(this);
+  AtomObserver::getInstance().Removed(this);
 }
 
Index: src/EntityObserver.hpp
===================================================================
--- src/EntityObserver.hpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
+++ src/EntityObserver.hpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -0,0 +1,72 @@
+/*
+ * EntityObserver.hpp
+ *
+ *  Created on: Dec 29, 2015
+ *      Author: heber
+ */
+
+
+#ifndef ENTITYOBSERVER_HPP_
+#define ENTITYOBSERVER_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/Observer/Relay.hpp"
+
+/** The EntityObserver is a central instance to all changes occuring within a set entities such as
+ * all atoms or all molecules.
+ *
+ * The intent is that if a class wants to know about changes in just _any_ single entity,
+ * he may register singly to this class and not to each and every one. This also
+ * keeps him updated in case of removed or added entities.
+ *
+ * \warning EntityObserver must get purged \b after World as we do not keep an
+ * an internal list of all entities. Hence, each one must get destroyed while
+ * the EntityObserver instance is still intact or segfault will occur.
+ *
+ * \section howto How to use EntityObserver
+ *
+ * All your template class, here T, needs to do is call Inserted() and Removed() functions
+ * in its cstor and dstor, respectively.
+ *
+ * Make this a singleton and add some static variables (for channels) in a derived class
+ * (derive both the singleton pattern and this template class).
+ *
+ */
+template <class T>
+class EntityObserver : public Relay
+{
+  //!> grant template class access to inserted and removed functions
+  friend T;
+
+  /** Inform all Observers of this EntityObserver that a new entity has been inserted.
+   *
+   * \param res the inserted entity
+   */
+  void Inserted(Observable *res);
+
+  /** Inform all Observers of this EntityObserver that a new entity has been removed.
+   *
+   * \param res the removed entity
+   */
+  void Removed(Observable *res);
+
+protected:
+
+  /** Constructor for EntityObserver.
+   *
+   * \param _Channels a set of channels for the entity to observe (e.g. all of them)
+   * \param _name name for this for the ObserverLog
+   */
+  EntityObserver(const Observable::channels_t &_Channels, const std::string &_name);
+
+  //!> ref to list of channels we observe
+  const Observable::channels_t &EntityChannels;
+};
+
+#include "EntityObserver_impl.hpp"
+
+#endif /* ENTITYOBSERVER_HPP_ */
Index: src/EntityObserver_impl.hpp
===================================================================
--- src/EntityObserver_impl.hpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
+++ src/EntityObserver_impl.hpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -0,0 +1,63 @@
+/*
+ * EntityObserver_impl.hpp
+ *
+ *  Created on: Dec 29, 2015
+ *      Author: heber
+ */
+
+
+#ifndef ENTITYOBSERVER_IMPL_HPP_
+#define ENTITYOBSERVER_IMPL_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <algorithm>
+
+#include <boost/bind.hpp>
+
+#include "CodePatterns/Observer/Channels.hpp"
+
+/** Private constructor of class EntityObserver.
+ *
+ */
+template <class T>
+EntityObserver<T>::EntityObserver(
+    const Observable::channels_t &_Channels,
+    const std::string &_name) :
+  Relay(_name),
+  EntityChannels(_Channels)
+{
+  Channels *OurChannel = new Channels();
+  Observable::insertNotificationChannel( std::make_pair(static_cast<Observable *>(this), OurChannel) );
+  std::for_each(EntityChannels.begin(), EntityChannels.end(),
+      boost::bind(&Channels::addChannel, OurChannel, _1));
+}
+
+/** Function to call when a new atom has been created.
+ *
+ * @param res
+ */
+template <class T>
+void EntityObserver<T>::Inserted(Observable *res)
+{
+  ASSERT( dynamic_cast<Observable *>(res) != NULL,
+      "EntityObserver<T>::Inserted - type is not derived from Observable.");
+  std::for_each(EntityChannels.begin(), EntityChannels.end(),
+      boost::bind(&Observable::signOn, res, this, _1, GlobalObservableInfo::PriorityDefault));
+}
+
+/** Function to call when an atom is about to get deleted.
+ *
+ * @param res
+ */
+template <class T>
+void EntityObserver<T>::Removed(Observable *res)
+{
+  std::for_each(EntityChannels.begin(), EntityChannels.end(),
+      boost::bind(&Observable::signOff, res, this, _1));
+}
+
+#endif /* ENTITYOBSERVER_IMPL_HPP_ */
Index: src/LinkedCell/unittests/Makefile.am
===================================================================
--- src/LinkedCell/unittests/Makefile.am	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/LinkedCell/unittests/Makefile.am	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -61,5 +61,4 @@
 	../LinkedCell/unittests/defs.hpp \
 	stubs/AtomStub.cpp \
-	../LinkedCell/unittests/stubs/AtomObserverStub.cpp \
 	../LinkedCell/unittests/stubs/ObserverBoxStub.cpp \
 	../LinkedCell/unittests/stubs/TesselPointStub.cpp \
Index: src/LinkedCell/unittests/stubs/AtomObserverStub.cpp
===================================================================
--- src/LinkedCell/unittests/stubs/AtomObserverStub.cpp	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Copyright (C)  2013 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/>.
- */
-
-/*
- * AtomObserverStub.cpp
- *
- *  Created on: Dec 22, 2011
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "Atom/AtomObserver.hpp"
-#include "Atom/atom_observable.hpp"
-
-#include "CodePatterns/Observer/Channels.hpp"
-#include "CodePatterns/Observer/Notification.hpp"
-#include "CodePatterns/Singleton_impl.hpp"
-
-AtomObserver::AtomObserver() :
-  Relay("AtomObserverStub")
-{
-  Channels *OurChannel = new Channels();
-  Observable::insertNotificationChannel( std::make_pair(static_cast<Observable *>(this), OurChannel) );
-  OurChannel->addChannel(AtomObservable::PositionChanged);
-}
-
-AtomObserver::~AtomObserver()
-{}
-
-CONSTRUCT_SINGLETON(AtomObserver);
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/Makefile.am	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -171,4 +171,6 @@
   Box_BoundaryConditions.hpp \
   config.hpp \
+  EntityObserver.hpp \
+  EntityObserver_impl.hpp \
   Formula.hpp \
   IdPool.hpp \
Index: src/MoleculeObserver.cpp
===================================================================
--- src/MoleculeObserver.cpp	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/MoleculeObserver.cpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -35,5 +35,5 @@
 #include "CodePatterns/MemDebug.hpp"
 
-#include "MoleculeObserver.hpp"
+#include <boost/assign.hpp>
 
 #include "CodePatterns/Singleton_impl.hpp"
@@ -41,63 +41,21 @@
 #include "molecule.hpp"
 
+#include "MoleculeObserver.hpp"
 
-/** Private constructor of class MoleculeObserver.
- *
- */
-MoleculeObserver::MoleculeObserver() :
-  Relay(std::string("MoleculeObserver"))
+using namespace boost::assign;
+
+static const Observable::channels_t getMoleculeChannels()
 {
-  Channels *OurChannel = new Channels();
-  Observable::insertNotificationChannel( std::make_pair(static_cast<Observable *>(this), OurChannel) );
-  OurChannel->addChannel(molecule::AtomInserted);
-  OurChannel->addChannel(molecule::AtomRemoved);
-  OurChannel->addChannel(molecule::AtomNrChanged);
-  OurChannel->addChannel(molecule::AtomMoved);
-  OurChannel->addChannel(molecule::FormulaChanged);
-  OurChannel->addChannel(molecule::MoleculeNameChanged);
-  OurChannel->addChannel(molecule::IndexChanged);
-  OurChannel->addChannel(molecule::BoundingBoxChanged);
-  OurChannel->addChannel(molecule::SelectionChanged);
+  Observable::channels_t channels;
+  for (int i=0;i<molecule::NotificationType_MAX; ++i)
+    channels += (enum molecule::NotificationType)i;
+  return channels;
 }
 
-/** Private Destructor of class MoleculeObserver.
- *
- */
-MoleculeObserver::~MoleculeObserver()
+const Observable::channels_t MoleculeObserver::MoleculeChannels(getMoleculeChannels());
+
+MoleculeObserver::MoleculeObserver() :
+    EntityObserver<molecule>(MoleculeChannels, std::string("MoleculeObserver"))
 {}
 
-/** Function to call when a new molecule has been created.
- *
- * @param res
- */
-void MoleculeObserver::MoleculeInserted(molecule *res)
-{
-  res->signOn(this, molecule::AtomInserted);
-  res->signOn(this, molecule::AtomRemoved);
-  res->signOn(this, molecule::AtomNrChanged);
-  res->signOn(this, molecule::AtomMoved);
-  res->signOn(this, molecule::FormulaChanged);
-  res->signOn(this, molecule::MoleculeNameChanged);
-  res->signOn(this, molecule::IndexChanged);
-  res->signOn(this, molecule::BoundingBoxChanged);
-  res->signOn(this, molecule::SelectionChanged);
-}
-
-/** Function to call when an molecule is about to get deleted.
- *
- * @param res
- */
-void MoleculeObserver::MoleculeRemoved(molecule *res)
-{
-  res->signOff(this, molecule::AtomInserted);
-  res->signOff(this, molecule::AtomRemoved);
-  res->signOff(this, molecule::AtomNrChanged);
-  res->signOff(this, molecule::AtomMoved);
-  res->signOff(this, molecule::FormulaChanged);
-  res->signOff(this, molecule::MoleculeNameChanged);
-  res->signOff(this, molecule::IndexChanged);
-  res->signOff(this, molecule::BoundingBoxChanged);
-  res->signOff(this, molecule::SelectionChanged);
-}
-
 CONSTRUCT_SINGLETON(MoleculeObserver)
Index: src/MoleculeObserver.hpp
===================================================================
--- src/MoleculeObserver.hpp	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/MoleculeObserver.hpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -14,6 +14,7 @@
 #endif
 
-#include "CodePatterns/Observer/Relay.hpp"
 #include "CodePatterns/Singleton.hpp"
+
+#include "EntityObserver.hpp"
 
 class molecule;
@@ -21,30 +22,18 @@
 /** The MoleculeObserver is a central instance to all changes occuring within molecules.
  *
- * The intent is that if a class wants to know about changes in just _any_ molecule,
- * he may register singly to this class and not to each and every molecule. This also
- * keeps him updated in case of removed or added molecules.
- *
- * \warning MoleculeObserver must get purged \b after World as we do not keep an
- * an internal list of all molecules. Hence, each molecule must get destroyed while
- * the MoleculeObserver instance is still intact or segfault will occur.
+ * It implements the templated EntityObserver class for molecules.
  *
  * \sa AtomObserver
  */
-class MoleculeObserver : public Singleton<MoleculeObserver>, public Relay
+class MoleculeObserver : public Singleton< MoleculeObserver >, public EntityObserver<molecule>
 {
   //!> grant Singleton access to cstor and dstor.
-  friend class Singleton<MoleculeObserver>;
+  friend class Singleton< MoleculeObserver >;
 
-  //!> grant molecule access
-  friend class molecule;
-public:
-
-private:
-  void MoleculeInserted(molecule *res);
-  void MoleculeRemoved(molecule *res);
+  //!> list of all observed channels
+  static const Observable::channels_t MoleculeChannels;
 
   // private constructor and destructor due to singleton
   MoleculeObserver();
-  virtual ~MoleculeObserver();
 };
 
Index: src/molecule.cpp
===================================================================
--- src/molecule.cpp	(revision 5d8f4f5fc5c4b1c6be8cfb8f938b76cfd81bf228)
+++ src/molecule.cpp	(revision d4ba3fafe2170e6e52d61b230122d20b71113b61)
@@ -118,5 +118,5 @@
 
   // inform MoleculeObserver about new molecule
-  MoleculeObserver::getInstance().MoleculeInserted(this);
+  MoleculeObserver::getInstance().Inserted(this);
 }
 
@@ -138,5 +138,5 @@
 
   // inform MoleculeObserver about removed molecule
-  MoleculeObserver::getInstance().MoleculeRemoved(this);
+  MoleculeObserver::getInstance().Removed(this);
 };
 
