Index: src/Fragmentation/Automation/MPQCFragmentController.hpp
===================================================================
--- src/Fragmentation/Automation/MPQCFragmentController.hpp	(revision f6c19d6c9eff8d0155c782c22a09f19969950170)
+++ src/Fragmentation/Automation/MPQCFragmentController.hpp	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
@@ -50,4 +50,7 @@
       );
 
+  void waitforResults(const size_t NoExpectedResults)
+  { results.waitforResults(NoExpectedResults, io_service, *this); }
+
   /** Get results map of calculated jobs.
    *
@@ -55,5 +58,6 @@
    */
   void getResults(std::map<JobId_t, MPQCData> &fragmentData) {
-    SpecificFragmentController::getResults<MPQCData>(fragmentData);
+    fragmentData = results.IdData;
+    results.clear();
   }
 
@@ -63,4 +67,8 @@
    */
   void run();
+
+private:
+  //!> type-specific result container
+  SpecificFragmentController::ResultContainer<MPQCData> results;
 };
 
Index: src/Fragmentation/Automation/Makefile.am
===================================================================
--- src/Fragmentation/Automation/Makefile.am	(revision f6c19d6c9eff8d0155c782c22a09f19969950170)
+++ src/Fragmentation/Automation/Makefile.am	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
@@ -17,5 +17,5 @@
 	Fragmentation/Automation/MPQCFragmentController.hpp \
 	Fragmentation/Automation/SpecificFragmentController.hpp \
-	Fragmentation/Automation/SpecificFragmentController_impl.hpp
+	Fragmentation/Automation/SpecificFragmentController_ResultContainer_impl.hpp
 	
 if CONDVMG
Index: src/Fragmentation/Automation/SpecificFragmentController.cpp
===================================================================
--- src/Fragmentation/Automation/SpecificFragmentController.cpp	(revision f6c19d6c9eff8d0155c782c22a09f19969950170)
+++ src/Fragmentation/Automation/SpecificFragmentController.cpp	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
@@ -56,21 +56,2 @@
   RunService("Requesting ids");
 }
-
-void SpecificFragmentController::waitforResults(const size_t NoExpectedResults)
-{
-  size_t NoCalculatedResults = 0;
-  while (NoCalculatedResults != NoExpectedResults) {
-    // wait a bit
-    boost::asio::deadline_timer timer(io_service);
-    timer.expires_from_now(boost::posix_time::milliseconds(500));
-    timer.wait();
-    // then request status
-    FragmentController::checkResults(host, port);
-    RunService("Checking on results");
-
-    const std::pair<size_t, size_t> JobStatus = FragmentController::getJobStatus();
-    LOG(1, "INFO: #" << JobStatus.first << " are waiting in the queue and #" << JobStatus.second << " jobs are calculated so far.");
-    NoCalculatedResults = JobStatus.second;
-  }
-}
-
Index: src/Fragmentation/Automation/SpecificFragmentController.hpp
===================================================================
--- src/Fragmentation/Automation/SpecificFragmentController.hpp	(revision f6c19d6c9eff8d0155c782c22a09f19969950170)
+++ src/Fragmentation/Automation/SpecificFragmentController.hpp	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
@@ -39,5 +39,5 @@
 
   void requestIds(const size_t numberjobs);
-  void waitforResults(const size_t NoExpectedResults);
+  virtual void waitforResults(const size_t NoExpectedResults)=0;
   void RunService(const std::string message);
 
@@ -48,17 +48,49 @@
 
 protected:
-  template <typename T>
-  void getResults(std::map<JobId_t, T> &IdData);
 
-private:
-  /** Extracts specific Data type from received vector of FragmentResults.
+  /** Container for the results received from the server.
    *
-   * @param results results to extract specific Data type from
-   * @param fragmentData on return array filled with extracted specific Data type
+   * These are received bit by bit until all jobs are calculated.
+   * This struct takes of the waiting.
+   *
    */
   template <typename T>
-  void ConvertFragmentResultTo(
-      const std::vector<FragmentResult::ptr> &results,
-      std::vector<T> &fragmentData);
+  struct ResultContainer {
+    /** cycle to wait for results
+     *
+     * \param NoExpectedResults number of expected results
+     * \param io_service service used for waiting
+     * \param callback ref to call controller functions
+     */
+    void waitforResults(
+        const size_t NoExpectedResults,
+        boost::asio::io_service &io_service,
+        SpecificFragmentController &callback);
+
+    /** Internal function to receive results if some are present.
+     *
+     * \param callback ref to call controller functions
+     * \return number of received results
+     */
+    size_t receiveResults(SpecificFragmentController &callback);
+
+    /** Extracts specific Data type from received vector of FragmentResults.
+     *
+     * @param results results to extract specific Data type from
+     * @param fragmentData on return array filled with extracted specific Data type
+     */
+    void ConvertFragmentResultTo(
+        const std::vector<FragmentResult::ptr> &results,
+        std::vector<T> &fragmentData);
+
+    /** Clears all internally stored results.
+     *
+     */
+    void clear()
+    { IdData.clear(); }
+
+    //!> internal container for the received data
+    std::map<JobId_t, T> IdData;
+  };
 
 protected:
@@ -67,10 +99,9 @@
   //!> port of the server to control
   std::string port;
-private:
   //!> reference to io_service for internal purposes
   boost::asio::io_service &io_service;
 };
 
-#include "SpecificFragmentController_impl.hpp"
+#include "SpecificFragmentController_ResultContainer_impl.hpp"
 
 #endif /* SPECIFICFRAGMENTCONTROLLER_HPP_ */
Index: src/Fragmentation/Automation/SpecificFragmentController_ResultContainer_impl.hpp
===================================================================
--- src/Fragmentation/Automation/SpecificFragmentController_ResultContainer_impl.hpp	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
+++ src/Fragmentation/Automation/SpecificFragmentController_ResultContainer_impl.hpp	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
@@ -0,0 +1,112 @@
+/*
+ * SpecificFragmentController_impl.hpp
+ *
+ *  Created on: Aug 27, 2012
+ *      Author: heber
+ */
+
+#ifndef SPECIFICFRAGMENTCONTROLLER_IMPL_HPP_
+#define SPECIFICFRAGMENTCONTROLLER_IMPL_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "SpecificFragmentController.hpp"
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/toString.hpp"
+
+
+template <typename T>
+size_t SpecificFragmentController::ResultContainer<T>::receiveResults(
+    SpecificFragmentController &callback)
+{
+  // receive (and remove the respective ids)
+  callback.receiveResults(callback.host, callback.port);
+  callback.RunService("Requesting results");
+  std::vector<FragmentResult::ptr> fragmentresults = callback.getReceivedResults();
+
+  // convert
+  std::vector<T> fragmentData;
+  ConvertFragmentResultTo(fragmentresults, fragmentData);
+
+  // insert into map
+  std::vector<FragmentResult::ptr>::const_iterator resultiter = fragmentresults.begin();
+  typename std::vector<T>::const_iterator dataiter = fragmentData.begin();
+  for(;resultiter != fragmentresults.end(); ++resultiter, ++dataiter) {
+    const JobId_t _id = (*resultiter)->getId();
+#ifndef NDEBUG
+    std::pair<typename std::map<JobId_t, T>::iterator, bool> inserter =
+#endif
+    IdData.insert( std::make_pair( _id, *dataiter) );
+    ASSERT( inserter.second,
+        "SpecificFragmentController::ResultContainer::receiveResults() - result id "
+        +toString(inserter.first->first)+" already present.");
+  }
+  ASSERT( dataiter == fragmentData.end(),
+      "SpecificFragmentController::ResultContainer::receiveResults() - fragmentresults and fragmentdata differ in size.");
+  return fragmentData.size();
+}
+
+template <typename T>
+void SpecificFragmentController::ResultContainer<T>::waitforResults(
+    const size_t NoExpectedResults,
+    boost::asio::io_service &io_service,
+    SpecificFragmentController &callback)
+{
+  // wait but receive all results that are already done
+  size_t NoReceivedResults = 0;
+  size_t oldNoCalculatedResults = 0;
+  while (NoReceivedResults != NoExpectedResults) {
+    // wait a bit
+    boost::asio::deadline_timer timer(io_service);
+    timer.expires_from_now(boost::posix_time::milliseconds(500));
+    timer.wait();
+    // then request status
+    callback.checkResults(callback.host, callback.port);
+    callback.RunService("Checking on results");
+
+    const std::pair<size_t, size_t> JobStatus = callback.getJobStatus();
+    const size_t NoCalculatedResults = JobStatus.second;
+    if (NoCalculatedResults != oldNoCalculatedResults) {
+      oldNoCalculatedResults = NoCalculatedResults;
+      LOG(1, "INFO: #" << JobStatus.first << " are waiting in the queue and #" << JobStatus.second << " jobs are calculated so far.");
+    }
+
+    // if some are done, get them
+    if (NoCalculatedResults != 0) {
+      NoReceivedResults += receiveResults(callback);
+    }
+  }
+}
+
+template <typename T>
+void SpecificFragmentController::ResultContainer<T>::ConvertFragmentResultTo(
+    const std::vector<FragmentResult::ptr> &results,
+    std::vector<T> &fragmentData)
+{
+  // extract results
+  fragmentData.clear();
+  fragmentData.reserve(results.size());
+
+  LOG(2, "DEBUG: Parsing now through " << results.size() << " results.");
+  for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
+      iter != results.end(); ++iter) {
+    //LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result));
+    T extractedData;
+    std::stringstream inputstream((*iter)->result);
+    LOG(2, "DEBUG: First 50 characters FragmentResult's string: "+(*iter)->result.substr(0, 50));
+    boost::archive::text_iarchive ia(inputstream);
+    ia >> extractedData;
+    LOG(1, "INFO: extracted data is " << extractedData << ".");
+    fragmentData.push_back(extractedData);
+  }
+
+  ASSERT( results.size() == fragmentData.size(),
+      "ConvertFragmentResultTo() - the number of extracted data differs from the number of results.");
+}
+
+#endif /* SPECIFICFRAGMENTCONTROLLER_IMPL_HPP_ */
Index: src/Fragmentation/Automation/SpecificFragmentController_impl.hpp
===================================================================
--- src/Fragmentation/Automation/SpecificFragmentController_impl.hpp	(revision f6c19d6c9eff8d0155c782c22a09f19969950170)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/*
- * SpecificFragmentController_impl.hpp
- *
- *  Created on: Aug 27, 2012
- *      Author: heber
- */
-
-#ifndef SPECIFICFRAGMENTCONTROLLER_IMPL_HPP_
-#define SPECIFICFRAGMENTCONTROLLER_IMPL_HPP_
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "SpecificFragmentController.hpp"
-
-#include "CodePatterns/Assert.hpp"
-#include "CodePatterns/toString.hpp"
-
-
-template <typename T>
-void SpecificFragmentController::getResults(std::map<JobId_t, T> &IdData)
-{
-  // receive
-  receiveResults(host, port);
-  RunService("Requesting results");
-  std::vector<FragmentResult::ptr> fragmentresults = getReceivedResults();
-  // convert
-  std::vector<T> fragmentData;
-  ConvertFragmentResultTo<T>(fragmentresults, fragmentData);
-  // put into map
-  IdData.clear();
-  std::vector<FragmentResult::ptr>::const_iterator resultiter = fragmentresults.begin();
-  typename std::vector<T>::const_iterator dataiter = fragmentData.begin();
-  for(;resultiter != fragmentresults.end(); ++resultiter, ++dataiter) {
-#ifndef NDEBUG
-    std::pair<typename std::map<JobId_t, T>::iterator, bool> inserter =
-#endif
-    IdData.insert( std::make_pair( (*resultiter)->getId(), *dataiter) );
-    ASSERT( inserter.second,
-        "SpecificFragmentController::getResults() - result id "
-        +toString(inserter.first->first)+" already present.");
-  }
-  ASSERT( dataiter == fragmentData.end(),
-      "SpecificFragmentController::getResults() - fragmentresults and fragmentdata differ in size.");
-}
-
-template <typename T>
-void SpecificFragmentController::ConvertFragmentResultTo(
-    const std::vector<FragmentResult::ptr> &results,
-    std::vector<T> &fragmentData)
-{
-  // extract results
-  fragmentData.clear();
-  fragmentData.reserve(results.size());
-
-  LOG(2, "DEBUG: Parsing now through " << results.size() << " results.");
-  for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
-      iter != results.end(); ++iter) {
-    //LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result));
-    T extractedData;
-    std::stringstream inputstream((*iter)->result);
-    LOG(2, "DEBUG: First 50 characters FragmentResult's string: "+(*iter)->result.substr(0, 50));
-    boost::archive::text_iarchive ia(inputstream);
-    ia >> extractedData;
-    LOG(1, "INFO: extracted data is " << extractedData << ".");
-    fragmentData.push_back(extractedData);
-  }
-
-  ASSERT( results.size() == fragmentData.size(),
-      "ConvertFragmentResultTo() - the number of extracted data differs from the number of results.");
-}
-
-
-#endif /* SPECIFICFRAGMENTCONTROLLER_IMPL_HPP_ */
Index: src/Fragmentation/Automation/VMGDebugGridFragmentController.hpp
===================================================================
--- src/Fragmentation/Automation/VMGDebugGridFragmentController.hpp	(revision f6c19d6c9eff8d0155c782c22a09f19969950170)
+++ src/Fragmentation/Automation/VMGDebugGridFragmentController.hpp	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
@@ -44,8 +44,16 @@
       const bool _OpenBoundaryConditions = false);
 
+  void waitforResults(const size_t NoExpectedResults)
+  { results.waitforResults(NoExpectedResults, io_service, *this); }
+
   // there are no results but server has empty string nonetheless
   void getResults(std::map<JobId_t, std::string> &fragmentData) {
-    SpecificFragmentController::getResults<std::string>(fragmentData);
+    fragmentData = results.IdData;
+    results.clear();
   }
+
+private:
+  //!> type-specific result container
+  SpecificFragmentController::ResultContainer<std::string> results;
 };
 
Index: src/Fragmentation/Automation/VMGFragmentController.hpp
===================================================================
--- src/Fragmentation/Automation/VMGFragmentController.hpp	(revision f6c19d6c9eff8d0155c782c22a09f19969950170)
+++ src/Fragmentation/Automation/VMGFragmentController.hpp	(revision 6285776145c5bb3604f2a9b1387bdcc7c69c1ffe)
@@ -75,4 +75,7 @@
       const bool _OpenBoundaryConditions = false);
 
+  void waitforResults(const size_t NoExpectedResults)
+  { results.waitforResults(NoExpectedResults, io_service, *this); }
+
   /** Get results of finished long-range jobs.
    *
@@ -80,6 +83,11 @@
    */
   void getResults(std::map<JobId_t, VMGData> &fragmentData) {
-    SpecificFragmentController::getResults<VMGData>(fragmentData);
+    fragmentData = results.IdData;
+    results.clear();
   }
+
+private:
+  //!> type-specific result container
+  SpecificFragmentController::ResultContainer<VMGData> results;
 };
 
