Index: src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 766767c66b905081c5796b3988065b0f0c31b855)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
@@ -59,4 +59,5 @@
 #include "Fragmentation/Automation/FragmentationResults.hpp"
 #include "Fragmentation/Automation/MPQCFragmentController.hpp"
+#include "Fragmentation/Automation/parseKeySetFile.hpp"
 #include "Fragmentation/Automation/VMGDebugGridFragmentController.hpp"
 #include "Fragmentation/Automation/VMGFragmentController.hpp"
@@ -75,5 +76,4 @@
 #include "Fragmentation/Summation/writeTable.hpp"
 #include "Graph/DepthFirstSearchAnalysis.hpp"
-#include "Helpers/defs.hpp"
 #include "Jobs/MPQCJob.hpp"
 #include "Jobs/MPQCData.hpp"
@@ -251,24 +251,13 @@
     return false;
 
+  if (!Energy.InitialiseIndices()) return false;
+
+  if (!Force.ParseIndices(KeySetFilename.c_str())) return false;
+
   // initialise keysets
   KeySetsContainer KeySet;
+  parseKeySetFile(KeySet, KeySetFilename, FragmentCounter, NonHydrogenKeySets);
   KeySetsContainer ForceKeySet;
-  if (!Energy.InitialiseIndices()) return false;
-
-  if (!Force.ParseIndices(KeySetFilename.c_str())) return false;
-
-  {
-    // else needs keysets without hydrogens
-    std::stringstream filename;
-    filename << FRAGMENTPREFIX << KEYSETFILE;
-    if (!KeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter)) return false;
-  }
-
-  {
-    // forces need keysets including hydrogens
-    std::stringstream filename;
-    filename << FRAGMENTPREFIX << FORCESFILE;
-    if (!ForceKeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter)) return false;
-  }
+  parseKeySetFile(ForceKeySet, KeySetFilename, FragmentCounter, HydrogenKeySets);
 
   // combine all found data
@@ -412,17 +401,10 @@
   // append all fragments to a HomologyContainer
   HomologyContainer::container_t values;
+  const size_t FragmentCounter = results.Result_perIndexSet_Energy.size();
+  KeySetsContainer KeySet;
+  parseKeySetFile(KeySet, KeySetFilename, FragmentCounter, NonHydrogenKeySets);
   KeySetsContainer ForceKeySet;
-  {
-    // forces need keysets including hydrogens
-    std::stringstream filename;
-    filename << FRAGMENTPREFIX << FORCESFILE;
-#ifndef NDEBUG
-    bool status =
-#endif
-        ForceKeySet.ParseKeySets(KeySetFilename, filename.str(), results.Result_perIndexSet_Energy.size());
-    ASSERT( status,
-        "FragmentationResults::FragmentationResults() - ParseKeySets() of "
-        +toString(FORCESFILE)+" failed.");
-  }
+  parseKeySetFile(ForceKeySet, KeySetFilename, FragmentCounter, HydrogenKeySets);
+
   // convert KeySetContainer to IndexSetContainer
   IndexSetContainer::ptr container(new IndexSetContainer(ForceKeySet));
Index: src/Fragmentation/Automation/FragmentationChargeDensity.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentationChargeDensity.cpp	(revision 766767c66b905081c5796b3988065b0f0c31b855)
+++ src/Fragmentation/Automation/FragmentationChargeDensity.cpp	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
@@ -48,4 +48,5 @@
 #include "Fragmentation/Automation/createMatrixNrLookup.hpp"
 #include "Fragmentation/Automation/extractJobIds.hpp"
+#include "Fragmentation/Automation/parseKeySetFile.hpp"
 #include "Fragmentation/Summation/IndexSetContainer.hpp"
 #include "Fragmentation/Summation/OrthogonalSumUpPerLevel.hpp"
@@ -72,16 +73,5 @@
   // initialise keysets
   KeySetsContainer KeySet;
-  {
-    // else needs keysets without hydrogens
-    std::stringstream filename;
-    filename << FRAGMENTPREFIX << KEYSETFILE;
-#ifndef NDEBUG
-    bool status =
-#endif
-        KeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter);
-    ASSERT( status,
-        "FragmentationResults::FragmentationResults() - ParseKeySets() of "
-        +toString(KEYSETFILE)+" failed.");
-  }
+  parseKeySetFile(KeySet, KeySetFilename, FragmentCounter, NonHydrogenKeySets);
 
   /// prepare for OrthogonalSummation
Index: src/Fragmentation/Automation/FragmentationResults.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentationResults.cpp	(revision 766767c66b905081c5796b3988065b0f0c31b855)
+++ src/Fragmentation/Automation/FragmentationResults.cpp	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
@@ -49,4 +49,5 @@
 #include "Fragmentation/Automation/createMatrixNrLookup.hpp"
 #include "Fragmentation/Automation/extractJobIds.hpp"
+#include "Fragmentation/Automation/parseKeySetFile.hpp"
 #include "Fragmentation/Summation/AllLevelOrthogonalSummator.hpp"
 #include "Fragmentation/Summation/IndexSetContainer.hpp"
@@ -79,30 +80,7 @@
   // initialise keysets
   KeySetsContainer KeySet;
+  parseKeySetFile(KeySet, KeySetFilename, MPQCFragmentCounter, NonHydrogenKeySets);
   KeySetsContainer ForceKeySet;
-  {
-    // else needs keysets without hydrogens
-    std::stringstream filename;
-    filename << FRAGMENTPREFIX << KEYSETFILE;
-#ifndef NDEBUG
-    bool status =
-#endif
-        KeySet.ParseKeySets(KeySetFilename, filename.str(), MPQCFragmentCounter);
-    ASSERT( status,
-        "FragmentationResults::FragmentationResults() - ParseKeySets() of "
-        +toString(KEYSETFILE)+" failed.");
-  }
-
-  {
-    // forces need keysets including hydrogens
-    std::stringstream filename;
-    filename << FRAGMENTPREFIX << FORCESFILE;
-#ifndef NDEBUG
-    bool status =
-#endif
-        ForceKeySet.ParseKeySets(KeySetFilename, filename.str(), MPQCFragmentCounter);
-    ASSERT( status,
-        "FragmentationResults::FragmentationResults() - ParseKeySets() of "
-        +toString(FORCESFILE)+" failed.");
-  }
+  parseKeySetFile(ForceKeySet, KeySetFilename, MPQCFragmentCounter, HydrogenKeySets);
 
   /// prepare for OrthogonalSummation
Index: src/Fragmentation/Automation/Makefile.am
===================================================================
--- src/Fragmentation/Automation/Makefile.am	(revision 766767c66b905081c5796b3988065b0f0c31b855)
+++ src/Fragmentation/Automation/Makefile.am	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
@@ -7,4 +7,5 @@
 	Fragmentation/Automation/FragmentationResults.cpp \
 	Fragmentation/Automation/MPQCFragmentController.cpp \
+	Fragmentation/Automation/parseKeySetFile.cpp \
 	Fragmentation/Automation/SpecificFragmentController.cpp
 
@@ -21,4 +22,5 @@
 	Fragmentation/Automation/FragmentationResults.hpp \
 	Fragmentation/Automation/MPQCFragmentController.hpp \
+	Fragmentation/Automation/parseKeySetFile.hpp \
 	Fragmentation/Automation/SpecificFragmentController.hpp \
 	Fragmentation/Automation/SpecificFragmentController_impl.hpp
Index: src/Fragmentation/Automation/parseKeySetFile.cpp
===================================================================
--- src/Fragmentation/Automation/parseKeySetFile.cpp	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
+++ src/Fragmentation/Automation/parseKeySetFile.cpp	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
@@ -0,0 +1,76 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the COPYING file or "Copyright notice" in builder.cpp for details.
+ * 
+ *
+ *   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/>. 
+ */
+
+/*
+ * parseKeySetFile.cpp
+ *
+ *  Created on: Sep 28, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "parseKeySetFile.hpp"
+
+#include <sstream>
+#include <string>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Fragmentation/KeySetsContainer.hpp"
+#include "Helpers/defs.hpp"
+
+
+void parseKeySetFile(
+    KeySetsContainer &KeySet,
+    const std::string &KeySetFilename,
+    const size_t FragmentCounter,
+    const enum KeySetFileType keysettype
+    )
+{
+  std::stringstream filename;
+  switch (keysettype) {
+    case NonHydrogenKeySets:
+      filename << FRAGMENTPREFIX << KEYSETFILE;
+      break;
+    case HydrogenKeySets:
+      filename << FRAGMENTPREFIX << FORCESFILE;
+      break;
+    default:
+      ASSERT(0, "parseKeySetFile() - unknown KeySetType.");
+  }
+
+#ifndef NDEBUG
+    bool status =
+#endif
+      KeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter);
+  ASSERT( status,
+      "FragmentationResults::FragmentationResults() - ParseKeySets() of "
+      +toString(KEYSETFILE)+" failed.");
+}
Index: src/Fragmentation/Automation/parseKeySetFile.hpp
===================================================================
--- src/Fragmentation/Automation/parseKeySetFile.hpp	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
+++ src/Fragmentation/Automation/parseKeySetFile.hpp	(revision 17c03fa7645e73b1b9eb1e67912eaaca6a1971cf)
@@ -0,0 +1,37 @@
+/*
+ * parseKeySetFile.hpp
+ *
+ *  Created on: Sep 28, 2012
+ *      Author: heber
+ */
+
+#ifndef PARSEKEYSETFILES_HPP_
+#define PARSEKEYSETFILES_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+class KeySetsContainer;
+
+/** Enumeration of the type of KeySet files for parseKeySetFile to choose.
+ *
+ */
+enum KeySetFileType
+{
+  NonHydrogenKeySets,   //!< KeySets excluding all hydrogen
+  HydrogenKeySets       //!< KeySets including all but saturation hydrogens
+};
+
+void parseKeySetFile(
+    KeySetsContainer &KeySet,
+    const std::string &KeySetFilename,
+    const size_t FragmentCounter,
+    const enum KeySetFileType keysettype
+    );
+
+#endif /* PARSEKEYSETFILES_HPP_ */
