Index: src/Fragmentation/Automation/FragmentController.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentController.cpp	(revision e032b43e18141e53eb0ce8b43ac92a8842c57459)
+++ src/Fragmentation/Automation/FragmentController.cpp	(revision 4dd16e4bf5f26ec09f04a28ed1029538fce01522)
@@ -34,4 +34,6 @@
 #include "Operations/Controllers/SendJobsOperation.hpp"
 #include "Operations/Controllers/ShutdownOperation.hpp"
+
+#include "Jobs/MPQCCommandJob_MPQCData.hpp"
 
 /** Constructor of class FragmentController.
@@ -78,2 +80,124 @@
 }
 
+
+/** Requests an available id from server
+ *
+ * @param host address of server
+ * @param service port/service of server
+ */
+void FragmentController::requestId(
+		const std::string &host,
+		const std::string &service)
+{
+  GetNextJobIdOperation *getnextid = static_cast<GetNextJobIdOperation *>(
+  		Commands.getByName("getnextjobid"));
+  (*getnextid)(host,service);
+}
+
+/** Returns another available id from a finished GetNextJobIdOperation.
+ *
+ * @return next available id
+ */
+JobId_t FragmentController::getAvailableId()
+{
+  GetNextJobIdOperation *getnextid = static_cast<GetNextJobIdOperation *>(
+  		Commands.getByName("getnextjobid"));
+	const JobId_t nextid = getnextid->getNextId();
+	LOG(1, "INFO: Next available id is " << nextid << ".");
+	return nextid;
+}
+
+/** Adds a vector of jobs to the send operation.
+ *
+ * @param jobs jobs to add
+ */
+void FragmentController::addJobs(std::vector<FragmentJob::ptr> &jobs)
+{
+  SendJobsOperation *sendjobs = static_cast<SendJobsOperation *>(
+  		Commands.getByName("sendjobs"));
+  sendjobs->addJobs(jobs);
+  const size_t presentJobs = sendjobs->getPresentJobs();
+	LOG(1, "INFO: #" << presentJobs << " jobs are now waiting to be transmitted.");
+}
+
+/** Sends contained jobs in operation to server
+ *
+ * @param host address of server
+ * @param service port/service of server
+ */
+void FragmentController::sendJobs(
+		const std::string &host,
+		const std::string &service)
+{
+  SendJobsOperation *sendjobs = static_cast<SendJobsOperation *>(
+  		Commands.getByName("sendjobs"));
+  const size_t presentJobs = sendjobs->getPresentJobs();
+	LOG(1, "INFO: #" << presentJobs << " jobs are being sent to the server.");
+  (*sendjobs)(host, service);
+}
+
+/** Obtains scheduled and done jobs from server
+ *
+ * @param host address of server
+ * @param service port/service of server
+ */
+void FragmentController::checkResults(
+		const std::string &host,
+		const std::string &service)
+{
+  CheckResultsOperation *checkres = static_cast<CheckResultsOperation *>(
+  		Commands.getByName("checkresults"));
+  (*checkres)(host, service);
+}
+
+/** Prints scheduled and done jobs.
+ *
+ */
+void FragmentController::printDoneJobs()
+{
+  CheckResultsOperation *checkres = static_cast<CheckResultsOperation *>(
+  		Commands.getByName("checkresults"));
+  const size_t doneJobs = checkres->getDoneJobs();
+  const size_t presentJobs = checkres->getPresentJobs();
+  LOG(1, "INFO: #" << presentJobs << " are waiting in the queue and #" << doneJobs << " jobs are calculated so far.");
+}
+
+/** Obtains results from done jobs from server.
+ *
+ * @param host address of server
+ * @param service port/service of server
+ */
+void FragmentController::receiveResults(
+		const std::string &host,
+		const std::string &service)
+{
+  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
+  		Commands.getByName("receiveresults"));
+  (*receiveres)(host, service);
+}
+
+/** Getter for received results.
+ *
+ * @return vector with all received results
+ */
+std::vector<FragmentResult::ptr> FragmentController::getReceivedResults()
+{
+  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
+  		Commands.getByName("receiveresults"));
+  return receiveres->getResults();
+}
+
+/** Sends shutdown signal to server
+ *
+ * @param host address of server
+ * @param service port/service of server
+ */
+void FragmentController::shutdown(
+		const std::string &host,
+		const std::string &service)
+{
+  ShutdownOperation *shutdown = static_cast<ShutdownOperation *>(
+  		Commands.getByName("shutdown"));
+  (*shutdown)(host, service);
+}
+
Index: src/Fragmentation/Automation/FragmentController.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentController.hpp	(revision e032b43e18141e53eb0ce8b43ac92a8842c57459)
+++ src/Fragmentation/Automation/FragmentController.hpp	(revision 4dd16e4bf5f26ec09f04a28ed1029538fce01522)
@@ -19,4 +19,5 @@
 
 #include "Connection.hpp"
+#include "JobId.hpp"
 #include "Jobs/FragmentJob.hpp"
 #include "Results/FragmentResult.hpp"
@@ -42,4 +43,14 @@
   size_t getExitflag() const;
 
+  void requestId(const std::string &host, const std::string &service);
+  JobId_t getAvailableId();
+  void addJobs(std::vector<FragmentJob::ptr> &jobs);
+  void sendJobs(const std::string &host, const std::string &service);
+  void checkResults(const std::string &host, const std::string &service);
+  void printDoneJobs();
+  void receiveResults(const std::string &host, const std::string &service);
+  std::vector<FragmentResult::ptr> getReceivedResults();
+  void shutdown(const std::string &host, const std::string &service);
+
 protected:
   /// The Connection to the server.
Index: src/Fragmentation/Automation/controller.cpp
===================================================================
--- src/Fragmentation/Automation/controller.cpp	(revision e032b43e18141e53eb0ce8b43ac92a8842c57459)
+++ src/Fragmentation/Automation/controller.cpp	(revision 4dd16e4bf5f26ec09f04a28ed1029538fce01522)
@@ -40,11 +40,5 @@
 #include "CodePatterns/Log.hpp"
 #include "FragmentController.hpp"
-#include "Operations/Controllers/CheckResultsOperation.hpp"
-#include "Operations/Controllers/GetNextJobIdOperation.hpp"
-#include "Operations/Controllers/ReceiveResultsOperation.hpp"
-#include "Operations/Controllers/SendJobsOperation.hpp"
-#include "Operations/Controllers/ShutdownOperation.hpp"
 #include "Jobs/MPQCCommandJob.hpp"
-#include "Jobs/MPQCCommandJob_MPQCData.hpp"
 #include "Jobs/SystemCommandJob.hpp"
 #include "Results/FragmentResult.hpp"
@@ -60,34 +54,12 @@
 };
 
-/** Requests an available id from server
- *
- * @param controller FragmentController with CommandRegistry
- * @param host address of server
- * @param service port/service of server
- */
-void requestid(
-    FragmentController &controller,
-    const std::string &host,
-    const std::string &service)
-{
-  GetNextJobIdOperation *getnextid = static_cast<GetNextJobIdOperation *>(
-      controller.Commands.getByName("getnextjobid"));
-  (*getnextid)(host,service);
-}
-
-/** Returns another available id from a finished GetNextJobIdOperation.
- *
- * @param controller FragmentController with CommandRegistry
- * @return next available id
- */
-JobId_t getavailableid(FragmentController &controller)
-{
-  GetNextJobIdOperation *getnextid = static_cast<GetNextJobIdOperation *>(
-      controller.Commands.getByName("getnextjobid"));
-  const JobId_t nextid = getnextid->getNextId();
-  LOG(1, "INFO: Next available id is " << nextid << ".");
-  return nextid;
-}
-
+
+/** Creates a SystemCommandJob out of give \a command with \a argument.
+ *
+ * @param jobs created job is added to this vector
+ * @param command command to execute for SystemCommandJob
+ * @param argument argument for command to execute
+ * @param nextid id for this job
+ */
 void createjobs(
     std::vector<FragmentJob::ptr> &jobs,
@@ -96,4 +68,5 @@
     const JobId_t nextid)
 {
+
   FragmentJob::ptr testJob( new SystemCommandJob(command, argument, nextid) );
   jobs.push_back(testJob);
@@ -123,92 +96,10 @@
 }
 
-/** Adds a vector of jobs to the send operation.
- *
- * @param controller FragmentController with CommandRegistry
- * @param jobs jobs to add
- */
-void addjobs(
-    FragmentController &controller,
-    std::vector<FragmentJob::ptr> &jobs)
-{
-  SendJobsOperation *sendjobs = static_cast<SendJobsOperation *>(
-      controller.Commands.getByName("sendjobs"));
-  sendjobs->addJobs(jobs);
-  const size_t presentJobs = sendjobs->getPresentJobs();
-  LOG(1, "INFO: #" << presentJobs << " jobs are now waiting to be transmitted.");
-}
-
-/** Sends contained jobs in operation to server
- *
- * @param controller FragmentController with CommandRegistry
- * @param host address of server
- * @param service port/service of server
- */
-void sendjobs(
-    FragmentController &controller,
-    const std::string &host,
-    const std::string &service)
-{
-  SendJobsOperation *sendjobs = static_cast<SendJobsOperation *>(
-      controller.Commands.getByName("sendjobs"));
-  const size_t presentJobs = sendjobs->getPresentJobs();
-  LOG(1, "INFO: #" << presentJobs << " jobs are being sent to the server.");
-  (*sendjobs)(host, service);
-}
-
-/** Obtains scheduled and done jobs from server
- *
- * @param controller FragmentController with CommandRegistry
- * @param host address of server
- * @param service port/service of server
- */
-void checkresults(
-    FragmentController &controller,
-    const std::string &host,
-    const std::string &service)
-{
-  CheckResultsOperation *checkres = static_cast<CheckResultsOperation *>(
-      controller.Commands.getByName("checkresults"));
-  (*checkres)(host, service);
-}
-
-/** Prints scheduled and done jobs.
- *
- * @param controller FragmentController with CommandRegistry
- */
-void printdonejobs(FragmentController &controller)
-{
-  CheckResultsOperation *checkres = static_cast<CheckResultsOperation *>(
-      controller.Commands.getByName("checkresults"));
-  const size_t doneJobs = checkres->getDoneJobs();
-  const size_t presentJobs = checkres->getPresentJobs();
-  LOG(1, "INFO: #" << presentJobs << " are waiting in the queue and #" << doneJobs << " jobs are calculated so far.");
-}
-
-/** Obtains results from done jobs from server.
- *
- * @param controller FragmentController with CommandRegistry
- * @param host address of server
- * @param service port/service of server
- */
-void receiveresults(
-    FragmentController &controller,
-    const std::string &host,
-    const std::string &service)
-{
-  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
-      controller.Commands.getByName("receiveresults"));
-  (*receiveres)(host, service);
-}
-
 /** Print received results.
  *
- * @param controller FragmentController with CommandRegistry
- */
-void printreceivedresults(FragmentController &controller)
-{
-  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
-      controller.Commands.getByName("receiveresults"));
-  std::vector<FragmentResult::ptr> results = receiveres->getResults();
+ * @param results received results to print
+ */
+void printReceivedResults(std::vector<FragmentResult::ptr> &results)
+{
   for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
       iter != results.end(); ++iter)
@@ -218,12 +109,9 @@
 /** Print received results.
  *
- * @param controller FragmentController with CommandRegistry
- */
-void printreceivedmpqcresults(FragmentController &controller, const std::string &KeySetFilename)
-{
-  ReceiveResultsOperation *receiveres = static_cast<ReceiveResultsOperation *>(
-      controller.Commands.getByName("receiveresults"));
-  std::vector<FragmentResult::ptr> results = receiveres->getResults();
-
+ * @param results vector of all received FragmentResult's
+ * @param KeySetFilename filename containing keysets
+ */
+void printreceivedmpqcresults(std::vector<FragmentResult::ptr> &results, const std::string &KeySetFilename)
+{
   // parse in KeySetfile
 //  const size_t MAXBUFFER = 256;
@@ -249,20 +137,4 @@
     LOG(1, "INFO: extracted data is " << extractedData << ".");
   }
-}
-
-/** Sends shutdown signal to server
- *
- * @param controller FragmentController with CommandRegistry
- * @param host address of server
- * @param service port/service of server
- */
-void shutdown(
-    FragmentController &controller,
-    const std::string &host,
-    const std::string &service)
-{
-  ShutdownOperation *shutdown = static_cast<ShutdownOperation *>(
-      controller.Commands.getByName("shutdown"));
-  (*shutdown)(host, service);
 }
 
@@ -327,5 +199,5 @@
           // get an id for every filename
           for (int argcount = 4; argcount < argc; ++argcount) {
-            requestid(controller, argv[1], argv[2]);
+            controller.requestId(argv[1], argv[2]);
           }
         }
@@ -338,5 +210,5 @@
           ELOG(1, "'createjobs' requires two options: [command] [argument].");
         } else {
-          requestid(controller, argv[1], argv[2]);
+          controller.requestId(argv[1], argv[2]);
         }
         break;
@@ -372,5 +244,5 @@
         } else {
           for (int argcount = 4; argcount < argc; ++argcount) {
-            const JobId_t next_id = getavailableid(controller);
+            const JobId_t next_id = controller.getAvailableId();
             const std::string filename(argv[argcount]);
             LOG(1, "INFO: Creating MPQCCommandJob with filename'"
@@ -378,6 +250,6 @@
             parsejob(jobs, filename, next_id);
           }
-          addjobs(controller, jobs);
-          sendjobs(controller, argv[1], argv[2]);
+          controller.addJobs(jobs);
+          controller.sendJobs(argv[1], argv[2]);
         }
         break;
@@ -387,35 +259,31 @@
         std::vector<FragmentJob::ptr> jobs;
         if (argc < 6) {
-                ELOG(1, "'createjobs' requires two options: [command] [argument].");
-              } else {
-                const JobId_t next_id = getavailableid(controller);
-                const std::string command(argv[4]);
-                const std::string argument(argv[5]);
-          LOG(1, "INFO: Creating SystemCommandJob with command '"
-            +command+"', argument '"+argument+"', and id "+toString(next_id)+".");
-          createjobs(jobs, command, argument, next_id);
-        }
-        addjobs(controller, jobs);
-        sendjobs(controller, argv[1], argv[2]);
+          ELOG(1, "'createjobs' requires two options: [command] [argument].");
+        } else {
+          const JobId_t next_id = controller.getAvailableId();
+          createjobs(jobs, argv[4], argv[5], next_id);
+          controller.addJobs(jobs);
+          controller.sendJobs(argv[1], argv[2]);
+        }
         break;
       }
       case CheckResultsIndex:
       {
-        checkresults(controller, argv[1], argv[2]);
+        controller.checkResults(argv[1], argv[2]);
         break;
       }
       case ReceiveResultsIndex:
       {
-        receiveresults(controller, argv[1], argv[2]);
+        controller.receiveResults(argv[1], argv[2]);
         break;
       }
       case ReceiveMPQCIndex:
       {
-        receiveresults(controller, argv[1], argv[2]);
+        controller.receiveResults(argv[1], argv[2]);
         break;
       }
       case ShutdownIndex:
       {
-        shutdown(controller, argv[1], argv[2]);
+        controller.shutdown(argv[1], argv[2]);
         break;
       }
@@ -440,10 +308,11 @@
       case CheckResultsIndex:
       {
-        printdonejobs(controller);
+        controller.printDoneJobs();
         break;
       }
       case ReceiveResultsIndex:
       {
-        printreceivedresults(controller);
+        std::vector<FragmentResult::ptr> results = controller.getReceivedResults();
+        printReceivedResults(results);
         break;
       }
@@ -455,5 +324,6 @@
           const std::string KeySetFilename = argv[4];
           LOG(1, "INFO: Parsing id associations from " << KeySetFilename << ".");
-          printreceivedmpqcresults(controller, KeySetFilename);
+          std::vector<FragmentResult::ptr> results = controller.getReceivedResults();
+          printreceivedmpqcresults(results, KeySetFilename);
         }
         break;
@@ -475,2 +345,3 @@
   return Exitflag;
 }
+
