Index: src/Fragmentation/AdaptivityMap.cpp
===================================================================
--- src/Fragmentation/AdaptivityMap.cpp	(revision 730d7a4efc3a2396723036e90420b93ff9ed3b03)
+++ src/Fragmentation/AdaptivityMap.cpp	(revision 851be8001d3ee00fa3ac2cfd8ae65a67a8bced04)
@@ -23,4 +23,5 @@
 #include <fstream>
 
+#include "CodePatterns/Assert.hpp"
 #include "CodePatterns/Log.hpp"
 
@@ -51,6 +52,8 @@
  * \param value energy value
  */
-void AdaptivityMap::InsertIntoAdaptiveCriteriaList(std::map<int, std::pair<double,int> > *AdaptiveCriteriaList, int FragOrder, int No, double Value) const
-{
+void AdaptivityMap::InsertIntoAdaptiveCriteriaList(int FragOrder, int No, double Value)
+{
+  ASSERT( AdaptiveCriteriaList != NULL,
+      "AdaptivityMap::InsertIntoAdaptiveCriteriaList() - AdaptiveCriteriaList is not allocated yet.");
   const_iterator marker = find(No);    // find keyset to Frag No.
   if (marker != end()) {  // if found
@@ -80,9 +83,7 @@
 /** Scans the adaptive order file and insert (index, value) into map.
  * \param &path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative)
- * \return adaptive criteria list from file
- */
-std::map<int, std::pair<double,int> > * AdaptivityMap::ScanAdaptiveFileIntoMap(std::string &path)
-{
-  std::map<int, pair<double,int> > *AdaptiveCriteriaList = new std::map<int, pair<double,int> >;
+ */
+void AdaptivityMap::ScanAdaptiveFileIntoMap(std::string &path)
+{
   int No = 0, FragOrder = 0;
   double Value = 0.;
@@ -93,5 +94,5 @@
   if (InputFile.fail()) {
     DoeLog(1) && (eLog() << Verbose(1) << "Cannot find file " << filename << "." << endl);
-    return AdaptiveCriteriaList;
+    return;
   }
 
@@ -113,5 +114,5 @@
 
         // clean the list of those entries that have been superceded by higher order terms already
-        InsertIntoAdaptiveCriteriaList(AdaptiveCriteriaList, FragOrder, No, Value);
+        InsertIntoAdaptiveCriteriaList(FragOrder, No, Value);
       }
     }
@@ -120,21 +121,19 @@
     InputFile.clear();
   }
-
-  return AdaptiveCriteriaList;
 };
 
 /** Maps adaptive criteria list back onto (Value, (Root Nr., Order))
  * (i.e. sorted by value to pick the highest ones)
- * \param *out output stream for debugging
- * \param &AdaptiveCriteriaList list to insert into
  * \param *mol molecule with atoms
  * \return remapped list
  */
-std::map<double, std::pair<int,int> >  * AdaptivityMap::ReMapAdaptiveCriteriaListToValue(std::map<int, std::pair<double,int> > *AdaptiveCriteriaList, molecule *mol)
+void AdaptivityMap::ReMapAdaptiveCriteriaListToValue(molecule *mol)
 {
   atom *Walker = NULL;
-  std::map<double, std::pair<int,int> > *FinalRootCandidates = new std::map<double, std::pair<int,int> > ;
+  ASSERT( AdaptiveCriteriaList != NULL,
+      "AdaptivityMap::ReMapAdaptiveCriteriaListToValue() - AdaptiveCriteriaList is not allocated yet.");
+  FinalRootCandidates = new AdaptiveCriteriaValueMap;
   DoLog(1) && (Log() << Verbose(1) << "Root candidate list is: " << endl);
-  for(std::map<int, std::pair<double,int> >::iterator runner = AdaptiveCriteriaList->begin(); runner != AdaptiveCriteriaList->end(); runner++) {
+  for(AdaptiveCriteriaIndexMap::const_iterator runner = AdaptiveCriteriaList->begin(); runner != AdaptiveCriteriaList->end(); runner++) {
     Walker = mol->FindAtom((*runner).first);
     if (Walker != NULL) {
@@ -151,5 +150,4 @@
     }
   }
-  return FinalRootCandidates;
 };
 
@@ -175,2 +173,40 @@
   return lines;
 };
+
+/** Marks all candidate sites for update if below adaptive threshold.
+ * Picks a given number of highest values and set *AtomMask to true.
+ * \param *AtomMask defines true/false per global Atom::Nr to mask in/out each nuclear site, used to activate given number of site to increment order adaptively
+ * \param Order desired order
+ * \param *mol molecule with atoms
+ * \return true - if update is necessary, false - not
+ */
+bool AdaptivityMap::MarkUpdateCandidates(bool *AtomMask, int Order, molecule *mol) const
+{
+  atom *Walker = NULL;
+  int No = -1;
+  bool status = false;
+  ASSERT( FinalRootCandidates != NULL,
+      "AdaptivityMap::MarkUpdateCandidates() - FinalRootCandidates is not allocated yet.");
+  for(AdaptiveCriteriaValueMap::const_iterator runner = FinalRootCandidates->upper_bound(pow(10.,Order)); runner != FinalRootCandidates->end(); runner++) {
+    No = (*runner).second.first;
+    Walker = mol->FindAtom(No);
+    //if (Walker->AdaptiveOrder < MinimumRingSize[Walker->getNr()]) {
+      DoLog(2) && (Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl);
+      AtomMask[No] = true;
+      status = true;
+    //} else
+      //Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", however MinimumRingSize of " << MinimumRingSize[Walker->getNr()] << " does not allow further adaptive increase." << endl;
+  }
+  return status;
+};
+
+/** Checks whether there are any adaptive items currently.
+ *
+ * @return true - there are items for adaptive refinement, false - there are none
+ */
+bool AdaptivityMap::IsAdaptiveCriteriaListEmpty() const
+{
+  ASSERT( AdaptiveCriteriaList != NULL,
+      "AdaptivityMap::ReMapAdaptiveCriteriaListToValue() - AdaptiveCriteriaList is not allocated yet.");
+  return AdaptiveCriteriaList->empty();
+}
Index: src/Fragmentation/AdaptivityMap.hpp
===================================================================
--- src/Fragmentation/AdaptivityMap.hpp	(revision 730d7a4efc3a2396723036e90420b93ff9ed3b03)
+++ src/Fragmentation/AdaptivityMap.hpp	(revision 851be8001d3ee00fa3ac2cfd8ae65a67a8bced04)
@@ -29,8 +29,18 @@
   ~AdaptivityMap();
 
-  void InsertIntoAdaptiveCriteriaList(std::map<int, std::pair<double,int> > *AdaptiveCriteriaList, int FragOrder, int No, double Value) const;
-  std::map<int, std::pair<double,int> > * ScanAdaptiveFileIntoMap(std::string &path);
-  std::map<double, std::pair<int,int> >  * ReMapAdaptiveCriteriaListToValue(std::map<int, std::pair<double,int> > *AdaptiveCriteriaList, molecule *mol);
+  void InsertIntoAdaptiveCriteriaList(int FragOrder, int No, double Value);
+  void ScanAdaptiveFileIntoMap(std::string &path);
+  void ReMapAdaptiveCriteriaListToValue(molecule *mol);
   int CountLinesinFile(std::ifstream &InputFile) const;
+  bool MarkUpdateCandidates(bool *AtomMask, int Order, molecule *mol) const ;
+
+  bool IsAdaptiveCriteriaListEmpty() const;
+
+private:
+  typedef std::map<double, std::pair<int,int> > AdaptiveCriteriaValueMap;
+  typedef std::map<int, std::pair<double,int> > AdaptiveCriteriaIndexMap;
+
+  AdaptiveCriteriaIndexMap *AdaptiveCriteriaList;
+  AdaptiveCriteriaValueMap *FinalRootCandidates;
 };
 
Index: src/Fragmentation/Fragmentation.cpp
===================================================================
--- src/Fragmentation/Fragmentation.cpp	(revision 730d7a4efc3a2396723036e90420b93ff9ed3b03)
+++ src/Fragmentation/Fragmentation.cpp	(revision 851be8001d3ee00fa3ac2cfd8ae65a67a8bced04)
@@ -468,6 +468,10 @@
 
     // parse the EnergyPerFragment file
-    std::map<int, std::pair<double,int> > *AdaptiveCriteriaList = IndexKeySetList->ScanAdaptiveFileIntoMap(path); // (Root No., (Value, Order)) !
-    if (AdaptiveCriteriaList->empty()) {
+    IndexKeySetList->ScanAdaptiveFileIntoMap(path); // (Root No., (Value, Order)) !
+    // then map back onto (Value, (Root Nr., Order)) (i.e. sorted by value to pick the highest ones)
+    IndexKeySetList->ReMapAdaptiveCriteriaListToValue(mol);
+
+    // pick the ones still below threshold and mark as to be adaptively updated
+    if (IndexKeySetList->IsAdaptiveCriteriaListEmpty()) {
       DoeLog(2) && (eLog()<< Verbose(2) << "Unable to parse file, incrementing all." << endl);
       for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
@@ -480,14 +484,9 @@
         }
       }
-    }
-    // then map back onto (Value, (Root Nr., Order)) (i.e. sorted by value to pick the highest ones)
-    std::map<double, std::pair<int,int> > *FinalRootCandidates = IndexKeySetList->ReMapAdaptiveCriteriaListToValue(AdaptiveCriteriaList, mol);
-
-    // pick the ones still below threshold and mark as to be adaptively updated
-    MarkUpdateCandidates(AtomMask, *FinalRootCandidates, Order, mol);
+    } else {
+      IndexKeySetList->MarkUpdateCandidates(AtomMask, Order, mol);
+    }
 
     delete[](IndexKeySetList);
-    delete[](AdaptiveCriteriaList);
-    delete[](FinalRootCandidates);
   } else { // global increase of Bond Order
     for(molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
Index: src/Fragmentation/fragmentation_helpers.cpp
===================================================================
--- src/Fragmentation/fragmentation_helpers.cpp	(revision 730d7a4efc3a2396723036e90420b93ff9ed3b03)
+++ src/Fragmentation/fragmentation_helpers.cpp	(revision 851be8001d3ee00fa3ac2cfd8ae65a67a8bced04)
@@ -37,34 +37,4 @@
 
 using namespace std;
-
-
-
-
-/** Marks all candidate sites for update if below adaptive threshold.
- * Picks a given number of highest values and set *AtomMask to true.
- * \param *out output stream for debugging
- * \param *AtomMask defines true/false per global Atom::Nr to mask in/out each nuclear site, used to activate given number of site to increment order adaptively
- * \param FinalRootCandidates list candidates to check
- * \param Order desired order
- * \param *mol molecule with atoms
- * \return true - if update is necessary, false - not
- */
-bool MarkUpdateCandidates(bool *AtomMask, std::map<double, std::pair<int,int> > &FinalRootCandidates, int Order, molecule *mol)
-{
-  atom *Walker = NULL;
-  int No = -1;
-  bool status = false;
-  for(map<double, pair<int,int> >::iterator runner = FinalRootCandidates.upper_bound(pow(10.,Order)); runner != FinalRootCandidates.end(); runner++) {
-    No = (*runner).second.first;
-    Walker = mol->FindAtom(No);
-    //if (Walker->AdaptiveOrder < MinimumRingSize[Walker->getNr()]) {
-      DoLog(2) && (Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl);
-      AtomMask[No] = true;
-      status = true;
-    //} else
-      //Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", however MinimumRingSize of " << MinimumRingSize[Walker->getNr()] << " does not allow further adaptive increase." << endl;
-  }
-  return status;
-};
 
 /** print atom mask for debugging.
Index: src/Fragmentation/fragmentation_helpers.hpp
===================================================================
--- src/Fragmentation/fragmentation_helpers.hpp	(revision 730d7a4efc3a2396723036e90420b93ff9ed3b03)
+++ src/Fragmentation/fragmentation_helpers.hpp	(revision 851be8001d3ee00fa3ac2cfd8ae65a67a8bced04)
@@ -22,11 +22,8 @@
 typedef std::deque<int> KeyStack;
 
-class AdaptivityMap;
-class bond;
 class Graph;
 class KeySet;
 class molecule;
 
-bool MarkUpdateCandidates(bool *AtomMask, std::map<double, std::pair<int,int> > &FinalRootCandidates, int Order, molecule *mol);
 void PrintAtomMask(bool *AtomMask, int AtomCount);
 
