Index: src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp	(revision c44763216bce0786fbe760047847c64ee5774937)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp	(revision f35f7edd5263c493f767a7510ab79feebd7cb651)
@@ -143,44 +143,44 @@
 }
 
-atomId_t QtObservedAtom::updateIndex()
-{
-  return const_cast<const World &>(World::getInstance()).lastChangedAtomId();
+#ifdef HAVE_INLINE
+inline
+#endif
+atomId_t QtObservedAtom::updateIndex(const atom &_atomref)
+{
+  return _atomref.getId();
 }
 
 QtObservedAtom::ListOfBonds_t QtObservedAtom::updateBonds(
-    const boost::function<const atomId_t ()> &_getAtomIndex)
+    const atom &_atom)
 {
   ListOfBonds_t ListOfBonds;
-  const atom * const _atom = getAtomConst(_getAtomIndex());
-  if (_atom != NULL) {
-    // make sure bonds is up-to-date
-    const BondList ListBonds = _atom->getListOfBonds();
-    for (BondList::const_iterator iter = ListBonds.begin();
-        iter != ListBonds.end();
-        ++iter)
-      ListOfBonds.insert( ListOfBonds.end(), std::make_pair(
-          (*iter)->leftatom->getId(),
-          (*iter)->rightatom->getId()) );
-  }
+  // make sure bonds is up-to-date
+  const BondList ListBonds = _atom.getListOfBonds();
+  for (BondList::const_iterator iter = ListBonds.begin();
+      iter != ListBonds.end();
+      ++iter)
+    ListOfBonds.insert( ListOfBonds.end(), std::make_pair(
+        (*iter)->leftatom->getId(),
+        (*iter)->rightatom->getId()) );
   return ListOfBonds;
 }
 
+#ifdef HAVE_INLINE
+inline
+#endif
 atomicNumber_t QtObservedAtom::updateElement(
-    const boost::function<const atomId_t ()> &_getAtomIndex)
-{
-  const atom * const _atom = getAtomConst(_getAtomIndex());
-  if (_atom != NULL) {
-    return _atom->getElementNo();
-  } else {
-    return (atomicNumber_t)-1;
-  }
-}
-
+    const atom &_atom)
+{
+  return _atom.getElementNo();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
 QtObservedMolecule* QtObservedAtom::updateMoleculeIndex(
-    const boost::function<const atomId_t ()> &_getAtomIndex)
-{
-  const atom * const _atom = getAtomConst(_getAtomIndex());
-  if ((_atom != NULL) && (_atom->getMolecule() != NULL)) {
-    const moleculeId_t molid = _atom->getMolecule()->getId();
+    const atom &_atom)
+{
+  if (_atom.getMolecule() != NULL) {
+    const moleculeId_t molid = _atom.getMolecule()->getId();
       QtObservedMolecule* mol = board.getObservedMolecule(molid).get();
       if (mol != NULL)
@@ -193,35 +193,29 @@
 }
 
+#ifdef HAVE_INLINE
+inline
+#endif
 std::string QtObservedAtom::updateName(
-    const boost::function<const atomId_t ()> &_getAtomIndex)
-{
-  const atom * const _atom = getAtomConst(_getAtomIndex());
-  if (_atom != NULL) {
-    return _atom->getName();
-  } else {
-    return std::string("");
-  }
-}
-
+    const atom &_atom)
+{
+  return _atom.getName();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
 Vector QtObservedAtom::updatePosition(
-    const boost::function<const atomId_t ()> &_getAtomIndex)
-{
-  const atom * const _atom = getAtomConst(_getAtomIndex());
-  if (_atom != NULL) {
-    return _atom->getPosition();
-  } else {
-    return zeroVec;
-  }
-}
-
+    const atom &_atom)
+{
+  return _atom.getPosition();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
 bool QtObservedAtom::updateSelected(
-    const boost::function<const atomId_t ()> &_getAtomIndex)
-{
-  const atom * const _atom = getAtomConst(_getAtomIndex());
-  if (_atom != NULL) {
-    return _atom->getSelected();
-  } else {
-    return false;
-  }
+    const atom &_atom)
+{
+  return _atom.getSelected();
 }
 
@@ -353,10 +347,10 @@
   // fill ObservedValues: index first
   const boost::function<atomId_t ()> AtomIndexUpdater(
-      boost::bind(&QtObservedAtom::updateIndex));
+      boost::bind(&QtObservedAtom::updateIndex, boost::cref(*_atomref)));
 
   ObservedValue_wCallback<atomId_t> * const IndexObservable =
       new ObservedValue_wCallback<atomId_t>(
           _atomref,
-          boost::bind(&QtObservedAtom::updateIndex),
+          AtomIndexUpdater,
           "AtomIndex_"+toString(_id),
           _id,
@@ -371,15 +365,15 @@
   // fill ObservedValues: then all the other that need index
   const boost::function<ListOfBonds_t ()> AtomBondsUpdater(
-      boost::bind(&QtObservedAtom::updateBonds, AtomIndexGetter));
+      boost::bind(&QtObservedAtom::updateBonds, boost::cref(*_atomref)));
   const boost::function<atomicNumber_t ()> AtomElementUpdater(
-      boost::bind(&QtObservedAtom::updateElement, AtomIndexGetter));
+      boost::bind(&QtObservedAtom::updateElement, boost::cref(*_atomref)));
   const boost::function<QtObservedMolecule* ()> AtomMoleculeUpdater(
-      boost::bind(&QtObservedAtom::updateMoleculeIndex, this, AtomIndexGetter));
+      boost::bind(&QtObservedAtom::updateMoleculeIndex, this, boost::cref(*_atomref)));
   const boost::function<std::string ()> AtomNameUpdater(
-      boost::bind(&QtObservedAtom::updateName, AtomIndexGetter));
+      boost::bind(&QtObservedAtom::updateName, boost::cref(*_atomref)));
   const boost::function<Vector ()> AtomPositionUpdater(
-      boost::bind(&QtObservedAtom::updatePosition, AtomIndexGetter));
+      boost::bind(&QtObservedAtom::updatePosition, boost::cref(*_atomref)));
   const boost::function<bool ()> AtomSelectedUpdater(
-      boost::bind(&QtObservedAtom::updateSelected, AtomIndexGetter));
+      boost::bind(&QtObservedAtom::updateSelected, boost::cref(*_atomref)));
 
   _ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t, atomId_t>(
Index: src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp	(revision c44763216bce0786fbe760047847c64ee5774937)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp	(revision f35f7edd5263c493f767a7510ab79feebd7cb651)
@@ -151,17 +151,11 @@
 
 private:
-  static atomId_t updateIndex();
-  static ListOfBonds_t updateBonds(
-      const boost::function<const atomId_t ()> &_getAtomIndex);
-  static atomicNumber_t updateElement(
-      const boost::function<const atomId_t ()> &_getAtomIndex);
-  QtObservedMolecule* updateMoleculeIndex(
-      const boost::function<const atomId_t ()> &_getAtomIndex);
-  static std::string updateName(
-      const boost::function<const atomId_t ()> &_getAtomIndex);
-  static Vector updatePosition(
-      const boost::function<const atomId_t ()> &_getAtomIndex);
-  static bool updateSelected(
-      const boost::function<const atomId_t ()> &_getAtomIndex);
+  static atomId_t updateIndex(const atom &_atomref);
+  static ListOfBonds_t updateBonds(const atom &_atom);
+  static atomicNumber_t updateElement(const atom &_atom);
+  QtObservedMolecule* updateMoleculeIndex(const atom &_atom);
+  static std::string updateName(const atom &_atom);
+  static Vector updatePosition(const atom &_atom);
+  static bool updateSelected(const atom &_atom);
 
   //!> enumeration of observed values to match with entries in ObservedValues
Index: src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp	(revision c44763216bce0786fbe760047847c64ee5774937)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp	(revision f35f7edd5263c493f767a7510ab79feebd7cb651)
@@ -336,5 +336,5 @@
   // fill ObservedValues: index first
   const boost::function<moleculeId_t ()> MolIndexUpdater(
-      boost::bind(&QtObservedMolecule::updateIndex));
+      boost::bind(&QtObservedMolecule::updateIndex, boost::cref(*_molref)));
 
   ObservedValue_wCallback<moleculeId_t> * const IndexObservable =
@@ -354,19 +354,19 @@
   // fill ObservedValues: then all the other that need index
   const boost::function<int ()> AtomCountUpdater(
-      boost::bind(&QtObservedMolecule::updateAtomCount, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateAtomCount, boost::cref(*_molref)));
   const boost::function<int ()> BondCountUpdater(
-      boost::bind(&QtObservedMolecule::updateBondCount, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateBondCount, boost::cref(*_molref)));
   const boost::function<Vector ()> MolCenterUpdater(
-      boost::bind(&QtObservedMolecule::updateCenter, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateCenter, boost::cref(*_molref)));
   const boost::function<std::string ()> MolFormulaUpdater(
-      boost::bind(&QtObservedMolecule::updateFormulaString, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateFormulaString, boost::cref(*_molref)));
   const boost::function<std::string ()> MolNameUpdater(
-      boost::bind(&QtObservedMolecule::updateName, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateName, boost::cref(*_molref)));
   const boost::function<int ()> NonHydrogenCountUpdater(
-      boost::bind(&QtObservedMolecule::updateNonHydrogenCount, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateNonHydrogenCount, boost::cref(*_molref)));
   const boost::function<molecule::BoundingBoxInfo ()> BoundingBoxUpdater(
-      boost::bind(&QtObservedMolecule::updateBoundingBox, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateBoundingBox, boost::cref(*_molref)));
   const boost::function<bool ()> SelectedUpdater(
-      boost::bind(&QtObservedMolecule::updateSelected, MolIndexGetter));
+      boost::bind(&QtObservedMolecule::updateSelected, boost::cref(*_molref)));
 
   _ObservedValues[AtomCount] = new ObservedValue_wCallback<int, moleculeId_t>(
@@ -451,87 +451,74 @@
 }
 
-int QtObservedMolecule::updateAtomCount(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->getAtomCount();
-  else
-    return (int)0;
-}
-
-int QtObservedMolecule::updateBondCount(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->getBondCount();
-  else
-    return (int)0;
-}
-
-molecule::BoundingBoxInfo QtObservedMolecule::updateBoundingBox(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->getBoundingBox();
-  else
-    return molecule::BoundingBoxInfo();
-}
-
-std::string QtObservedMolecule::updateFormulaString(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->getFormula().toString();
-  else
-    return std::string("");
-}
-
-Vector QtObservedMolecule::updateCenter(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->DetermineCenterOfAll();
-  else
-    return zeroVec;
-}
-
-moleculeId_t QtObservedMolecule::updateIndex()
-{
-  return const_cast<const World &>(World::getInstance()).lastChangedMolId();
-}
-
-std::string QtObservedMolecule::updateName(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->getName();
-  else
-    return std::string("");
-}
-
-int QtObservedMolecule::updateNonHydrogenCount(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->getNoNonHydrogen();
-  else
-    return (int)0;
-}
-
-bool QtObservedMolecule::updateSelected(
-    const boost::function<const moleculeId_t ()> &_getMolIndex)
-{
-  const molecule * const mol = getMolecule(_getMolIndex());
-  if (mol != NULL)
-    return mol->getSelected();
-  else
-    return false;
+#ifdef HAVE_INLINE
+inline
+#endif
+int QtObservedMolecule::updateAtomCount(const molecule &mol)
+{
+  return mol.getAtomCount();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+int QtObservedMolecule::updateBondCount(const molecule &mol)
+{
+  return mol.getBondCount();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+molecule::BoundingBoxInfo QtObservedMolecule::updateBoundingBox(const molecule &mol)
+{
+  return mol.getBoundingBox();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+std::string QtObservedMolecule::updateFormulaString(const molecule &mol)
+{
+  return mol.getFormula().toString();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+Vector QtObservedMolecule::updateCenter(const molecule &mol)
+{
+  return mol.DetermineCenterOfAll();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+moleculeId_t QtObservedMolecule::updateIndex(const molecule &mol)
+{
+  return mol.getId();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+std::string QtObservedMolecule::updateName(const molecule &mol)
+{
+  return mol.getName();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+int QtObservedMolecule::updateNonHydrogenCount(const molecule &mol)
+{
+  return mol.getNoNonHydrogen();
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+bool QtObservedMolecule::updateSelected(const molecule &mol)
+{
+  return mol.getSelected();
 }
 
Index: src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp	(revision c44763216bce0786fbe760047847c64ee5774937)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp	(revision f35f7edd5263c493f767a7510ab79feebd7cb651)
@@ -160,21 +160,13 @@
 
 private:
-  static int updateAtomCount(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
-  static int updateBondCount(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
-  static molecule::BoundingBoxInfo updateBoundingBox(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
-  static std::string updateFormulaString(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
-  static Vector updateCenter(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
-  static moleculeId_t updateIndex();
-  static std::string updateName(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
-  static int updateNonHydrogenCount(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
-  static bool updateSelected(
-      const boost::function<const moleculeId_t ()> &_getMolIndex);
+  static int updateAtomCount(const molecule &mol);
+  static int updateBondCount(const molecule &mol);
+  static molecule::BoundingBoxInfo updateBoundingBox(const molecule &mol);
+  static std::string updateFormulaString(const molecule &mol);
+  static Vector updateCenter(const molecule &mol);
+  static moleculeId_t updateIndex(const molecule &mol);
+  static std::string updateName(const molecule &mol);
+  static int updateNonHydrogenCount(const molecule &mol);
+  static bool updateSelected(const molecule &mol);
 
   //!> list of channels when atom count needs to update
