Index: src/UIElements/Makefile.am
===================================================================
--- src/UIElements/Makefile.am	(revision 98c35cae2ab1845620fc345902fa7bd0a1ab5d53)
+++ src/UIElements/Makefile.am	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
@@ -145,4 +145,6 @@
   UIElements/MainWindow.hpp \
   UIElements/Qt4/InstanceBoard/ObservedValue_types.hpp \
+  UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp \
+  UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp \
   UIElements/Views/Qt4/Qt3D/ObservedValue_UpdateAtoms.hpp \
   UIElements/Views/Qt4/Qt3D/ObservedValue_wCallback.hpp
Index: src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
+++ src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
@@ -0,0 +1,115 @@
+/*
+ * ObservedValuesContainer.hpp
+ *
+ *  Created on: Oct 29, 2015
+ *      Author: heber
+ */
+
+
+#ifndef OBSERVEDVALUESCONTAINER_HPP_
+#define OBSERVEDVALUESCONTAINER_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ObservedValue_types.hpp"
+
+#include <map>
+#include <string>
+
+class QtObservedInstanceBoard;
+
+/** This class contains ObservedValues of the class \b T each instance identified
+ * by the id type \b id.
+ *
+ * All the reference counting is done inside this container.
+ */
+template <class T, typename id>
+class ObservedValuesContainer
+{
+  /** Cstor of class ObservedValuesContainer.
+   *
+   * \param _name name used in debugging and prints
+   */
+  ObservedValuesContainer(const std::string _name) :
+    NameOfType(_name)
+  {}
+
+  /** Dstor of class ObservedValuesContainer.
+   *
+   */
+  ~ObservedValuesContainer()
+  {}
+
+  /** Delivers the set of Observed value for the instance identified by \a _id.
+   *
+   * \param _id identifier of the instance
+   * \return shared ptr to observed instance.
+   */
+  typename T::ptr get(const id _id);
+
+  /** Returns an observed instance identified by \a _id, for deallocation.
+   *
+   * \param _id identifier of the instance
+   */
+  void yield(const id _id);
+
+  ObservedValues_t getObservedValues(const id _id);
+
+  void returnObservedValues(const id _id, ObservedValues_t &_observedvalues);
+
+private:
+  typedef std::pair<ObservedValues_t, size_t> RefCountedObservedValues_t;
+  typedef std::map<id, RefCountedObservedValues_t> CountedObservedValues_t;
+  //!> internal vector of observed values
+  CountedObservedValues_t ObservedValues;
+
+  //!> name used in describing the instance type
+  const std::string NameOfType;
+
+private:
+  //!> QtObservedInstanceBoard may access anything
+  friend class QtObservedInstanceBoard;
+
+  /** Inserts a new ObservedValue vector into the container.
+   *
+   * \param _id identifier of instance associated with observed values
+   * \param _obsvalues vector of observed values of instance
+   * \return true - insertion successful, false - else
+   */
+  bool insert(const id _id, ObservedValues_t &_obsvalues);
+
+  /** Use to change the identifier associated with a vector of observed values.
+   *
+   * \param _oldid old identifier
+   * \param _newid new identifier
+   * \return true - change successful, false - else
+   */
+  bool changeIdentifier(const id _oldid, const id _newid);
+
+  /** Returns the number of reference delivered for this instance identified by \a _id.
+   *
+   * \param _id identifier of instance
+   * \return reference count
+   */
+  size_t getRefCount(const id _id) const;
+
+  /** Erases a vector of observed values of an instance  identified by \a _id.
+   *
+   * \param _id identifier of instance
+   * \return true - erase successful, false - else
+   */
+  bool erase(const id _id);
+
+  /** Checks whether a vector of observed values of an instance  identified by \a _id
+   * is present.
+   *
+   * \param _id identifier of instance
+   * \return true - present, false - else
+   */
+  bool isPresent(const id _id) const;
+};
+
+#endif /* OBSERVEDVALUESCONTAINER_HPP_ */
Index: src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
+++ src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
@@ -0,0 +1,135 @@
+/*
+ * ObservedValuesContainer_impl.hpp
+ *
+ *  Created on: Oct 29, 2015
+ *      Author: heber
+ */
+
+
+#ifndef OBSERVEDVALUESCONTAINER_IMPL_HPP_
+#define OBSERVEDVALUESCONTAINER_IMPL_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ObservedValuesContainer.hpp"
+
+#include "CodePatterns/Assert.hpp"
+
+template <class T, typename id>
+typename T::ptr ObservedValuesContainer<T,id>::get(const id _id)
+{
+  typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
+  ASSERT( iter != ObservedValues.end(),
+      "ObservedValuesContainer::getObservedValues() - no observed values present for "
+      +NameOfType+" "+toString(_id));
+  const ObservedValues_t &obsvalues = iter->second.first;
+  // increase refcount
+  ++(iter->second.second);
+  typename T::ptr _molecule(new T(obsvalues));
+
+  return _molecule;
+}
+
+template <class T, typename id>
+void ObservedValuesContainer<T,id>::yield(const id _id)
+{
+  typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
+  ASSERT( iter != ObservedValues.end(),
+      "ObservedValuesContainer::returnObservedAtom() - no observed values present for "
+      +NameOfType+" "+toString(_id));
+  ASSERT( iter->second.second != 0,
+      "ObservedValuesContainer::returnObservedAtom() - all instances for "
+      +NameOfType+" "+toString(_id)+" have already been returned.");
+  // decrease refcount
+  --(iter->second.second);
+  if (iter->second.second == 0) {
+    // free instance
+  }
+}
+
+template <class T, typename id>
+ObservedValues_t ObservedValuesContainer<T,id>::getObservedValues(const id _id)
+{
+  ObservedValues_t returnvalues;
+  typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
+  ASSERT(iter != ObservedValues.end(),
+      "ObservedValuesContainer::getObservedValues() - "+NameOfType
+      +" values not present for id "+toString(_id));
+  if (iter->first == _id) {
+    returnvalues = iter->second.first;
+    ObservedValues.erase(iter);
+  }
+  return returnvalues;
+}
+
+template <class T, typename id>
+void ObservedValuesContainer<T,id>::returnObservedValues(
+    const id _id,
+    ObservedValues_t &_observedvalues)
+{
+#ifndef NDEBUG
+  std::pair<typename CountedObservedValues_t::iterator, bool> inserter =
+#endif
+      ObservedValues.insert(
+          std::make_pair( _id, std::make_pair(_observedvalues,0) ) );
+  ASSERT( inserter.second,
+      "QtObservedInstanceBoard::returnAtomObservedValues() - could not insert ObservedValues for"
+      +toString(_id)+".");
+}
+
+template <class T, typename id>
+bool ObservedValuesContainer<T,id>::insert(const id _id, ObservedValues_t &_obsvalues)
+{
+  std::pair<typename CountedObservedValues_t::iterator, bool> inserter =
+      ObservedValues.insert(
+          std::make_pair( _id, std::make_pair(_obsvalues,0) ) );
+  return inserter.second;
+}
+
+template <class T, typename id>
+bool ObservedValuesContainer<T,id>::changeIdentifier(const id _oldid, const id _newid)
+{
+  const typename CountedObservedValues_t::iterator Colditer = ObservedValues.find(_oldid);
+  const typename CountedObservedValues_t::iterator Cnewiter = ObservedValues.find(_newid);
+  bool status = ((Colditer != ObservedValues.end()) && (Cnewiter == ObservedValues.end()));
+  // change id here only if still present
+  if (status) {
+    {
+      RefCountedObservedValues_t obsvalues = Colditer->second;
+      ObservedValues.erase(Colditer);
+      ObservedValues.insert( std::make_pair(_newid, obsvalues) );
+    }
+    return true;
+  } else
+    return false;
+}
+
+template <class T, typename id>
+size_t ObservedValuesContainer<T,id>::getRefCount(const id _id) const
+{
+  typename CountedObservedValues_t::const_iterator iter = ObservedValues.find(_id);
+  return iter->second.second;
+}
+
+template <class T, typename id>
+bool ObservedValuesContainer<T,id>::erase(const id _id)
+{
+  typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
+  if (iter != ObservedValues.end()) {
+    ObservedValues.erase(iter);
+    return true;
+  } else
+    return false;
+}
+
+template <class T, typename id>
+bool ObservedValuesContainer<T,id>::isPresent(const id _id) const
+{
+  typename CountedObservedValues_t::const_iterator iter = ObservedValues.find(_id);
+  return (iter != ObservedValues.end());
+}
+
+#endif /* OBSERVEDVALUESCONTAINER_IMPL_HPP_ */
Index: src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp	(revision 98c35cae2ab1845620fc345902fa7bd0a1ab5d53)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
@@ -23,4 +23,5 @@
 
 #include "UIElements/Qt4/InstanceBoard/ObservedValue_types.hpp"
+#include "UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp"
 #include "types.hpp"
 
@@ -41,4 +42,6 @@
   Q_OBJECT
 
+  //!> ObservedValuesContainer needs to access private cstor and dstor
+  friend class ObservedValuesContainer<QtObservedAtom, atomId_t>;
   //!> QtObservedInstanceBoard needs to access private cstor and dstor
   friend class QtObservedInstanceBoard;
Index: src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.cpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.cpp	(revision 98c35cae2ab1845620fc345902fa7bd0a1ab5d53)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.cpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
@@ -47,4 +47,5 @@
 #include "Descriptors/MoleculeIdDescriptor.hpp"
 #include "molecule.hpp"
+#include "UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp"
 #include "World.hpp"
 
@@ -53,4 +54,6 @@
   Observer("QtObservedInstanceBoard"),
   WorldSignedOn(false),
+  atomObservedValues("atom"),
+  moleculeObservedValues("molecule"),
   atomSubjectKilled(
       boost::bind(&QtObservedInstanceBoard::atomcountsubjectKilled, this, _1)),
@@ -139,9 +142,8 @@
               moleculeSubjectKilled);
 #ifndef NDEBUG
-          std::pair<moleculeObservedValues_t::iterator, bool> inserter =
+          bool status =
 #endif
-              moleculeObservedValues.insert(
-                  std::make_pair( _id, std::make_pair(ObservedValues,0) ));
-          ASSERT( inserter.second,
+              moleculeObservedValues.insert(_id, ObservedValues);
+          ASSERT( status,
               "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedValues for"
               +toString(_id)+".");
@@ -187,9 +189,8 @@
               atomSubjectKilled);
 #ifndef NDEBUG
-          std::pair<atomObservedValues_t::iterator, bool> inserter =
+          bool status  =
 #endif
-              atomObservedValues.insert(
-                  std::make_pair( _id, std::make_pair(ObservedValues,0) ));
-          ASSERT( inserter.second,
+              atomObservedValues.insert(_id, ObservedValues);
+          ASSERT( status,
               "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedValues for"
               +toString(_id)+".");
@@ -227,5 +228,5 @@
               << atomid << " from molecule " << molid);
           // check whether atom's observedvalues are present
-          ASSERT( atomObservedValues.find(atomid) != atomObservedValues.end(),
+          ASSERT( atomObservedValues.isPresent(atomid),
               "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "
               +toString(atomid)+" are not present yet.");
@@ -255,19 +256,11 @@
         const moleculeId_t newmoleculeId = dynamic_cast<molecule *>(publisher)->getId();
         LOG(3, "DEBUG: InformationBoard got IndexChanged from molecule " << molid << " to " << newmoleculeId);
-        {
-          moleculeObservedValues_t::iterator iter = moleculeObservedValues.find(molid);
-          // change id here only if still present
-          if (iter != moleculeObservedValues.end()) {
-            RefCountedObservedValues_t obsvalues = iter->second;
-            moleculeObservedValues.erase(iter);
-            ASSERT( moleculeObservedValues.find(newmoleculeId) == moleculeObservedValues.end(),
-                "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "
-                +toString(newmoleculeId)+" already present.");
-            moleculeObservedValues.insert( std::make_pair(newmoleculeId, obsvalues) );
-        //    if (!inserter.second)
-        //      ELOG(1, "QtInformationBoard could not insert molecule id change "
-        //          << molid << "->" << newmoleculeId);
-          }
-        }
+#ifndef NDEBUG
+        bool status =
+#endif
+        moleculeObservedValues.changeIdentifier(molid, newmoleculeId);
+        ASSERT( status,
+            "QtObservedInstanceBoard::recieveNotification() - cannot change molecule's id "
+            +toString(molid)+" "+toString(newmoleculeId)+" in moleculeObservedValues.");
         // no need update SignedOn, ref does not change
         emit moleculeIndexChanged(molid, newmoleculeId);
@@ -285,20 +278,5 @@
         const atomId_t newatomId = dynamic_cast<atom *>(publisher)->getId();
         LOG(3, "DEBUG: InformationBoard got IndexChanged from atom " << oldatomId << " to " << newatomId);
-        // update atomObservedValues
-        {
-          atomObservedValues_t::iterator iter = atomObservedValues.find(oldatomId);
-          // change id here only if still present
-          if (iter != atomObservedValues.end()) {
-            RefCountedObservedValues_t obsvalues = iter->second;
-            atomObservedValues.erase(iter);
-            ASSERT( atomObservedValues.find(newatomId) == atomObservedValues.end(),
-                "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "
-                +toString(newatomId)+" already present.");
-            atomObservedValues.insert( std::make_pair(newatomId, obsvalues) );
-      //    if (!inserter.second)
-      //      ELOG(1, "QtInformationBoard could not insert atom id change "
-      //          << oldatomId << "->" << newatomId);
-          }
-        }
+        atomObservedValues.changeIdentifier(oldatomId, newatomId);
         // no need update SignedOn, ref does not change
         emit atomIndexChanged(oldatomId, newatomId);
@@ -326,5 +304,5 @@
 
   if (iter->second > GLMoleculeObject_atom::MAX_ObservedTypes) {
-    ASSERT( atomObservedValues[_atomid].second == 0,
+    ASSERT( atomObservedValues.getRefCount(_atomid) == 0,
         "QtObservedInstanceBoard::atomcountsubjectKilled() - observed Values for atom "
         +toString(_atomid)+" are still being held somewhere.");
@@ -350,5 +328,5 @@
 
   if (iter->second > GLMoleculeObject_molecule::MAX_ObservedTypes) {
-    ASSERT( moleculeObservedValues[_molid].second == 0,
+    ASSERT( moleculeObservedValues.getRefCount(_molid) == 0,
         "QtObservedInstanceBoard::moleculecountsubjectKilled() - observed Values for molecule "
         +toString(_molid)+" are still being held somewhere.");
@@ -359,32 +337,31 @@
 }
 
-ObservedValues_t
-QtObservedInstanceBoard::getAtomObservedValues(const atomId_t _id)
-{
-  ObservedValues_t returnvalues;
-  const atomObservedValues_t::iterator iter = atomObservedValues.find(_id);
-  ASSERT(iter != atomObservedValues.end(),
-      "QtObservedInstanceBoard::getAtomObservedValues() - atom values not present for id"
-      +toString(_id));
-  if (iter->first == _id) {
-    returnvalues = iter->second.first;
-    atomObservedValues.erase(iter);
-  }
-  return returnvalues;
-}
-
-ObservedValues_t
-QtObservedInstanceBoard::getMoleculeObservedValues(const moleculeId_t _id)
-{
-  ObservedValues_t returnvalues;
-  const moleculeObservedValues_t::iterator iter = moleculeObservedValues.find(_id);
-  ASSERT(iter != moleculeObservedValues.end(),
-      "getMoleculeObservedValues::getAtomObservedValues() - molecule values not present for id"
-      +toString(_id));
-  if (iter->first == _id) {
-    returnvalues = iter->second.first;
-    moleculeObservedValues.erase(iter);
-  }
-  return returnvalues;
+QtObservedAtom::ptr QtObservedInstanceBoard::getObservedAtom(const atomId_t _id)
+{
+  return atomObservedValues.get(_id);
+}
+
+QtObservedMolecule::ptr QtObservedInstanceBoard::getObservedMolecule(const moleculeId_t _id)
+{
+  return moleculeObservedValues.get(_id);
+}
+
+void QtObservedInstanceBoard::returnObservedAtom(const atomId_t _id)
+{
+  atomObservedValues.yield(_id);
+}
+
+void QtObservedInstanceBoard::returnObservedMolecule(const moleculeId_t _id)
+{
+  moleculeObservedValues.yield(_id);
+}
+
+ObservedValues_t QtObservedInstanceBoard::getAtomObservedValues(const atomId_t _id)
+{
+  return atomObservedValues.getObservedValues(_id);
+}
+ObservedValues_t QtObservedInstanceBoard::getMoleculeObservedValues(const moleculeId_t _id)
+{
+  return moleculeObservedValues.getObservedValues(_id);
 }
 
@@ -394,14 +371,9 @@
 {
   if (lastremovedatom != _id) {
-#ifndef NDEBUG
-    std::pair<atomObservedValues_t::iterator, bool> inserter =
-#endif
-        atomObservedValues.insert(
-            std::make_pair( _id, std::make_pair(_observedvalues,0) ) );
-    ASSERT( inserter.second,
-        "QtObservedInstanceBoard::returnAtomObservedValues() - could not insert ObservedValues for"
-        +toString(_id)+".");
-  } else
+    atomObservedValues.returnObservedValues(_id, _observedvalues);
+  } else {
     lastremovedatom = (atomId_t)-1;
+    atomObservedValues.erase(_id);
+  }
 }
 
@@ -411,74 +383,9 @@
 {
   if (lastremovedmolecule != _id) {
-#ifndef NDEBUG
-      std::pair<moleculeObservedValues_t::iterator, bool> inserter =
-#endif
-          moleculeObservedValues.insert(
-              std::make_pair( _id, std::make_pair(_observedvalues,0) ) );
-      ASSERT( inserter.second,
-          "QtObservedInstanceBoard::returnMoleculeObservedValues() - could not insert ObservedValues for"
-          +toString(_id)+".");
-  } else
+    moleculeObservedValues.returnObservedValues(_id, _observedvalues);
+  } else {
     lastremovedmolecule = (moleculeId_t)-1;
-}
-
-QtObservedAtom::ptr QtObservedInstanceBoard::getObservedAtom(const atomId_t _id)
-{
-  atomObservedValues_t::iterator iter = atomObservedValues.find(_id);
-  ASSERT( iter != atomObservedValues.end(),
-      "QtObservedInstanceBoard::getObservedAtom() - no observed values present for atom "
-      +toString(_id));
-  const ObservedValues_t &obsvalues = iter->second.first;
-  // increase refcount
-  ++(iter->second.second);
-  QtObservedAtom::ptr _atom(new QtObservedAtom(obsvalues));
-
-  return _atom;
-}
-
-QtObservedMolecule::ptr QtObservedInstanceBoard::getObservedMolecule(const moleculeId_t _id)
-{
-  moleculeObservedValues_t::iterator iter = moleculeObservedValues.find(_id);
-  ASSERT( iter != moleculeObservedValues.end(),
-      "QtObservedInstanceBoard::getObservedMolecule() - no observed values present for molecule "
-      +toString(_id));
-  const ObservedValues_t &obsvalues = iter->second.first;
-  // increase refcount
-  ++(iter->second.second);
-  QtObservedMolecule::ptr _molecule(new QtObservedMolecule(obsvalues));
-
-  return _molecule;
-}
-
-void QtObservedInstanceBoard::returnObservedAtom(const atomId_t _id)
-{
-  atomObservedValues_t::iterator iter = atomObservedValues.find(_id);
-  ASSERT( iter != atomObservedValues.end(),
-      "QtObservedInstanceBoard::returnObservedAtom() - no observed values present for atom "
-      +toString(_id));
-  ASSERT( iter->second.second != 0,
-      "QtObservedInstanceBoard::returnObservedAtom() - all ObservedAtoms for atom "
-      +toString(_id)+" have already been returned.");
-  // decrease refcount
-  --(iter->second.second);
-  if (iter->second.second == 0) {
-    // free instance
-  }
-}
-
-void QtObservedInstanceBoard::returnObservedMolecule(const moleculeId_t _id)
-{
-  moleculeObservedValues_t::iterator iter = moleculeObservedValues.find(_id);
-  ASSERT( iter != moleculeObservedValues.end(),
-      "QtObservedInstanceBoard::returnObservedMolecule() - no observed values present for molecule "
-      +toString(_id));
-  ASSERT( iter->second.second != 0,
-      "QtObservedInstanceBoard::returnObservedMolecule() - all ObservedMolecules for molecule "
-      +toString(_id)+" have already been returned.");
-  // decrease refcount
-  --(iter->second.second);
-  if (iter->second.second == 0) {
-    // free instance
-  }
-}
-
+    moleculeObservedValues.erase(_id);
+  }
+}
+
Index: src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp	(revision 98c35cae2ab1845620fc345902fa7bd0a1ab5d53)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
@@ -26,4 +26,5 @@
 
 #include "UIElements/Qt4/InstanceBoard/ObservedValue_types.hpp"
+#include "UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp"
 #include "types.hpp"
 
@@ -81,10 +82,9 @@
   QtObservedAtom::ptr getObservedAtom(const atomId_t _id);
   QtObservedMolecule::ptr getObservedMolecule(const moleculeId_t _id);
+  void returnObservedAtom(const atomId_t _id);
+  void returnObservedMolecule(const moleculeId_t _id);
 
   ObservedValues_t getAtomObservedValues(const atomId_t _id);
   ObservedValues_t getMoleculeObservedValues(const moleculeId_t _id);
-
-  void returnObservedAtom(const atomId_t _id);
-  void returnObservedMolecule(const moleculeId_t _id);
 
   void returnAtomObservedValues(const atomId_t _id, ObservedValues_t &_observedvalues);
@@ -146,15 +146,8 @@
   moleculesubjectKilledCount_t moleculesubjectKilledCount;
 
-  typedef std::pair<ObservedValues_t, size_t> RefCountedObservedValues_t;
-
-  //!> typedef for the map of id to each one's ObservedValues
-  typedef typename std::map<atomId_t, RefCountedObservedValues_t> atomObservedValues_t;
-  //!> map containing all ObservedValues for each atom, associated by id
-  atomObservedValues_t atomObservedValues;
-
-  //!> typedef for the map of id to each one's ObservedValues
-  typedef typename std::map<moleculeId_t, RefCountedObservedValues_t> moleculeObservedValues_t;
-  //!> map containing all ObservedValues for each molecule, associated by id
-  moleculeObservedValues_t moleculeObservedValues;
+  //!> container with all ObservedValues for each atom, associated by id
+  ObservedValuesContainer<QtObservedAtom, atomId_t> atomObservedValues;
+  //!> container with all ObservedValues for each molecule, associated by id
+  ObservedValuesContainer<QtObservedMolecule, moleculeId_t> moleculeObservedValues;
 
   //!> stored callback function for notifying QtObservedInstanceBoard about subjectKilled in atom
Index: src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp	(revision 98c35cae2ab1845620fc345902fa7bd0a1ab5d53)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp	(revision 41e2870206d294aab5deb395396ac66cc7e3c0ab)
@@ -22,4 +22,5 @@
 
 #include "UIElements/Qt4/InstanceBoard/ObservedValue_types.hpp"
+#include "UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp"
 #include "types.hpp"
 
@@ -40,4 +41,6 @@
   Q_OBJECT
 
+  //!> ObservedValuesContainer needs to access private cstor and dstor
+  friend class ObservedValuesContainer<QtObservedMolecule, moleculeId_t>;
   //!> QtObservedInstanceBoard needs to access private cstor and dstor
   friend class QtObservedInstanceBoard;
