Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision cbcbbd63e97a2e60704da03bab709f5377d591aa)
+++ src/Makefile.am	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -381,6 +381,6 @@
   Fragmentation/Automation/Pool/WorkerPool.hpp
 
-Controller_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) controller.cpp controller_MPQCCommandJob.cpp controller_MPQCCommandJob.hpp ControllerCommand.hpp ControllerCommandRegistry.cpp ControllerCommandRegistry.hpp DefaultOptions.cpp DefaultOptions.hpp ControllerOptions.cpp ControllerOptions.hpp ControllerOptions_MPQCCommandJob.cpp ControllerOptions_MPQCCommandJob.hpp
-#controller_SystemCommandJob.cpp controller_SystemCommandJob.hpp ControllerOptions_SystemCommandJob.cpp ControllerOptions_SystemCommandJob.hpp
+Controller_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) controller.cpp controller_AddOn.hpp controller_AddOn_MPQCCommandJob.cpp controller_MPQCCommandJob.cpp controller_MPQCCommandJob.hpp ControllerCommand.hpp ControllerCommandRegistry.cpp ControllerCommandRegistry.hpp DefaultOptions.cpp DefaultOptions.hpp ControllerOptions.cpp ControllerOptions.hpp ControllerOptions_MPQCCommandJob.cpp ControllerOptions_MPQCCommandJob.hpp
+#controller_AddOn_SystemCommandJob.cpp controller_SystemCommandJob.cpp controller_SystemCommandJob.hpp ControllerOptions_SystemCommandJob.cpp ControllerOptions_SystemCommandJob.hpp
 Controller_LDFLAGS = $(AM_LDFLAGS) $(BOOST_PROGRAM__OPTIONS_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
 Controller_CXXFLAGS = $(AM_CPPFLAGS)
Index: src/controller.cpp
===================================================================
--- src/controller.cpp	(revision cbcbbd63e97a2e60704da03bab709f5377d591aa)
+++ src/controller.cpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -37,13 +37,13 @@
 #include <vector>
 
-#include "Fragmentation/Automation/atexit.hpp"
+#include "CodePatterns/Assert.hpp"
 #include "CodePatterns/Info.hpp"
 #include "CodePatterns/Log.hpp"
 
+#include "atexit.hpp"
 #include "FragmentController.hpp"
-#include "ControllerOptions_MPQCCommandJob.hpp"
 #include "ControllerCommandRegistry.hpp"
-
-#include "controller_MPQCCommandJob.hpp"
+#include "ControllerOptions.hpp"
+#include "controller_AddOn.hpp"
 
 /** Print the status of scheduled and done jobs.
@@ -75,5 +75,9 @@
   size_t Exitflag = 0;
 
-  ControllerOptions *ControllerInfo = allocateControllerInfo();
+  controller_AddOn *AddOn = getAddOn();
+  ASSERT(AddOn != NULL,
+      "main() - returned AddOn is NULL.");
+
+  ControllerOptions *ControllerInfo = AddOn->allocateControllerInfo();
   boost::asio::io_service io_service;
   FragmentController controller(io_service);
@@ -103,5 +107,5 @@
             boost::ref(controller), boost::cref(ControllerInfo->server), boost::cref(ControllerInfo->serverport)))
       ));
-  addSpecificCommands(registrator, controller, *ControllerInfo, vm);
+  AddOn->addSpecificCommands(registrator, controller, *ControllerInfo);
 
   // Declare the supported options.
@@ -113,5 +117,5 @@
       ("command", boost::program_options::value< std::string >(), (std::string("command to send to server: ")+toString(getListOfCommands(ControllerCommands))).c_str())
   ;
-  addSpecificOptions(desc.add_options());
+  AddOn->addSpecificOptions(desc.add_options());
 
   // parse command line
@@ -131,5 +135,5 @@
 
   // all later parse functions depend on parsed command
-  status = addOtherParsings(*ControllerInfo, vm, ControllerCommands);
+  status = AddOn->addOtherParsings(*ControllerInfo, vm);
   if (status) return status;
 
@@ -159,5 +163,5 @@
     std::cerr << e.what() << std::endl;
   }
-  delete ControllerInfo;
+  delete AddOn;
 
   return Exitflag;
Index: src/controller_AddOn.hpp
===================================================================
--- src/controller_AddOn.hpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
+++ src/controller_AddOn.hpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -0,0 +1,98 @@
+/*
+ * controller_AddOn.hpp
+ *
+ *  Created on: 01.06.2012
+ *      Author: heber
+ */
+
+#ifndef CONTROLLER_ADDON_HPP_
+#define CONTROLLER_ADDON_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <boost/function.hpp>
+#include <boost/program_options.hpp>
+
+class ControllerCommand;
+class ControllerCommandRegistry;
+class ControllerInfo;
+class ControllerOptions;
+class FragmentController;
+
+struct controller_AddOn;
+
+/** This is the allocator function for the specific controller addon structure.
+ *
+ * The implementation should reside in its own module such that it can be
+ * linked in unison with the \file controller.cpp and the derived implementation
+ * of controller_AddOn to the executable controller.
+ */
+extern "C++" controller_AddOn *getAddOn();
+
+/** This is the structure that contains functions to extend the functionality
+ * of the basic controller with respect to certain jobs and commands.
+ *
+ * Here, we have four types of functions:
+ * -# Allocator: Required to allocate to specific function which contains
+ *    extended member variables and parsing functions.
+ * -# Commands: Add more commands to the registry of the controller.
+ * -# Options: Add more command-line options to require additional information
+ *    from the user.
+ * -# Parsers: Add parsing function to place parameter from command-line
+ *    into internal structure allocated via Allocator.
+ *
+ * The allocated structure is the one which contains all information for the
+ * execution of these commands. Note that some defaults are already parsed
+ * and stored therein by the controller by default.
+ *
+ * \note All these functions are called within the basic controller, hence
+ * all parameters are instances of this basic controller.
+ */
+struct controller_AddOn {
+  /** Function to allocate a derived variant of ControllerOptions which might
+   * be extended by own member variables and parsing functions.
+   *
+   * \return Pointer to allocated instance of ControllerOptions or derived.
+   */
+  virtual ControllerOptions *allocateControllerInfo()=0;
+
+  /** Function to register new commands communicating with a server.
+   *
+   * \param registrator registrator function for the generated ControllerCommand
+   * \param controller access to controller to bind to its functions
+   * \param ControllerInfo All other options of the controller
+   */
+  virtual void addSpecificCommands(
+      boost::function<void (ControllerCommand *)> &registrator,
+      FragmentController &controller,
+      ControllerOptions &ControllerInfo)=0;
+
+  /** Function to add other command line options if more use input is required.
+   *
+   * \param option option_description entity that can be used to add another
+   *  boost::program_options as follows:
+   *  \code
+   *   option("command,c", boost::program_options::, "description");
+   *  \endcode
+   */
+  virtual void addSpecificOptions(
+      boost::program_options::options_description_easy_init option)=0;
+
+  /** Function to add a parsing function for placing info from the command line
+   * option into \a ControllerInfo.
+   *
+   * \param ControllerInfo May be reinterpret_cast to true type as has been
+   * allocated in controller_AddOn::allocateControllerInfo.
+   * \param vm map of command line variables
+   * \return 0 - ok, else - some failure code (which leads to program exit)
+   */
+  virtual int addOtherParsings(
+      ControllerOptions &ControllerInfo,
+      boost::program_options::variables_map &vm)=0;
+};
+
+#endif /* CONTROLLER_ADDON_HPP_ */
Index: src/controller_AddOn_MPQCCommandJob.cpp
===================================================================
--- src/controller_AddOn_MPQCCommandJob.cpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
+++ src/controller_AddOn_MPQCCommandJob.cpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -0,0 +1,29 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * controller_AddOn_MPQCCommandJob.cpp
+ *
+ *  Created on: 06.06.2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "controller_MPQCCommandJob.hpp"
+
+struct controller_AddOn;
+
+controller_AddOn *getAddOn()
+{
+  return new controller_MPQCCommandJob();
+}
Index: src/controller_AddOn_SystemCommandJob.cpp
===================================================================
--- src/controller_AddOn_SystemCommandJob.cpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
+++ src/controller_AddOn_SystemCommandJob.cpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -0,0 +1,29 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * controller_AddOn_SystemCommandJob.cpp
+ *
+ *  Created on: 04.06.2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "controller_SystemCommandJob.hpp"
+
+struct controller_AddOn;
+
+controller_AddOn *getAddOn()
+{
+  return new controller_SystemCommandJob();
+}
Index: src/controller_MPQCCommandJob.cpp
===================================================================
--- src/controller_MPQCCommandJob.cpp	(revision cbcbbd63e97a2e60704da03bab709f5377d591aa)
+++ src/controller_MPQCCommandJob.cpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -9,8 +9,7 @@
  * controller_MPQCCommandJob.cpp
  *
- *  Created on: Jun 6, 2012
+ *  Created on: 01.06.2012
  *      Author: heber
  */
-
 
 // include config.h
@@ -31,5 +30,5 @@
 
 #include "FragmentController.hpp"
-#include "Jobs/SystemCommandJob.hpp"
+#include "Jobs/MPQCCommandJob.hpp"
 #include "Results/FragmentResult.hpp"
 
@@ -47,4 +46,5 @@
 #include "Jobs/MPQCCommandJob.hpp"
 #include "Jobs/MPQCCommandJob_MPQCData.hpp"
+
 
 /** Creates a MPQCCommandJob with argument \a filename.
@@ -258,4 +258,5 @@
 }
 
+
 /** Creates a SystemCommandJob out of give \a command with \a argument.
  *
@@ -266,4 +267,7 @@
 {
   const JobId_t next_id = controller.getAvailableId();
+  LOG(2, "DEBUG: Creating new SystemCommandJob with '"
+      +toString(ControllerInfo.executable)+"' and argument '"
+      +toString(ControllerInfo.jobcommand)+"'.");
   FragmentJob::ptr testJob(
       new SystemCommandJob(ControllerInfo.executable, ControllerInfo.jobcommand, next_id) );
@@ -295,14 +299,23 @@
 }
 
-ControllerOptions *allocateControllerInfo()
+inline std::vector<std::string> getListOfCommands(const ControllerCommandRegistry &ControllerCommands)
+{
+  std::vector<std::string> Commands;
+  for (ControllerCommandRegistry::const_iterator iter = ControllerCommands.getBeginIter();
+      iter != ControllerCommands.getEndIter(); ++iter)
+    Commands.push_back(iter->first);
+
+  return Commands;
+}
+
+ControllerOptions *controller_MPQCCommandJob::allocateControllerInfo()
 {
   return new ControllerOptions_MPQCCommandJob();
 }
 
-void addSpecificCommands(
+void controller_MPQCCommandJob::addSpecificCommands(
     boost::function<void (ControllerCommand *)> &registrator,
     FragmentController &controller,
-    ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm)
+    ControllerOptions &ControllerInfo)
 {
   ControllerOptions_MPQCCommandJob &CI =
@@ -310,8 +323,8 @@
   registrator(new ControllerCommand("addjobs",
       boost::assign::list_of< ControllerCommand::commands_t >
-      (boost::bind(&FragmentController::requestIds,
-          boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport),
-          boost::bind(&std::vector<std::string>::size, boost::cref(CI.jobfiles))))
-      (boost::bind(&AddJobs, boost::ref(controller), boost::cref(CI)))
+        (boost::bind(&FragmentController::requestIds,
+            boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport),
+            boost::bind(&std::vector<std::string>::size, boost::cref(CI.jobfiles))))
+        (boost::bind(&AddJobs, boost::ref(controller), boost::cref(CI)))
       ));
   registrator(new ControllerCommand("createjobs",
@@ -320,4 +333,11 @@
             boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport), 1))
         (boost::bind(&createJobs, boost::ref(controller), boost::cref(CI)))
+      ));
+  registrator(new ControllerCommand("receiveresults",
+      boost::assign::list_of< ControllerCommand::commands_t >
+        (boost::bind(&FragmentController::receiveResults,
+            boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
+        (boost::bind(&printReceivedResults,
+            boost::bind(&FragmentController::getReceivedResults, boost::ref(controller))))
       ));
   registrator(new ControllerCommand("receivempqc",
@@ -329,33 +349,24 @@
             boost::cref(CI.fragmentpath),
             boost::bind(&getNoAtomsFromAdjacencyFile, boost::cref(CI.fragmentpath))))
-      ));
-  registrator(new ControllerCommand("receiveresults",
-      boost::assign::list_of< ControllerCommand::commands_t >
-        (boost::bind(&FragmentController::receiveResults,
-            boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
-        (boost::bind(&printReceivedResults,
-            boost::bind(&FragmentController::getReceivedResults, boost::ref(controller))))
-      ));
-}
-
-void addSpecificOptions(
+  ));
+}
+
+void controller_MPQCCommandJob::addSpecificOptions(
     boost::program_options::options_description_easy_init option)
 {
   option
-    ("executable", boost::program_options::value< std::string >(), "executable for commands 'addjobs' and 'createjobs'")
     ("jobcommand", boost::program_options::value< std::string >(), "command argument for executable for 'createjobs'")
+    ("executable", boost::program_options::value< std::string >(), "executable for commands 'createjobs'")
     ("fragment-path", boost::program_options::value< std::string >(), "path to fragment files for 'receivempqc'")
-    ("jobfiles", boost::program_options::value< std::vector< std::string > >()->multitoken(), "list of files as single argument to executable for 'addjobs'")
+    ("jobfiles", boost::program_options::value< std::vector< std::string > >()->multitoken(), "list of files as single argument toexecutable for 'addjobs'")
     ;
 }
 
-int addOtherParsings(
+int controller_MPQCCommandJob::addOtherParsings(
     ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm,
-    const ControllerCommandRegistry &ControllerCommands)
+    boost::program_options::variables_map &vm)
 {
   ControllerOptions_MPQCCommandJob &CI =
       reinterpret_cast<ControllerOptions_MPQCCommandJob &>(ControllerInfo);
-
   int status = 0;
   status = CI.parseExecutable(vm);
Index: src/controller_MPQCCommandJob.hpp
===================================================================
--- src/controller_MPQCCommandJob.hpp	(revision cbcbbd63e97a2e60704da03bab709f5377d591aa)
+++ src/controller_MPQCCommandJob.hpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -2,5 +2,5 @@
  * controller_MPQCCommandJob.hpp
  *
- *  Created on: Jun 6, 2012
+ *  Created on: 01.06.2012
  *      Author: heber
  */
@@ -9,5 +9,4 @@
 #define CONTROLLER_MPQCCOMMANDJOB_HPP_
 
-
 // include config.h
 #ifdef HAVE_CONFIG_H
@@ -15,7 +14,8 @@
 #endif
 
-
 #include <boost/function.hpp>
 #include <boost/program_options.hpp>
+
+#include "controller_AddOn.hpp"
 
 class ControllerCommand;
@@ -25,20 +25,20 @@
 class FragmentController;
 
-ControllerOptions *allocateControllerInfo();
+struct controller_MPQCCommandJob : public controller_AddOn
+{
+  ControllerOptions *allocateControllerInfo();
 
-void addSpecificCommands(
-    boost::function<void (ControllerCommand *)> &registrator,
-    FragmentController &controller,
-    ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm);
+  void addSpecificCommands(
+      boost::function<void (ControllerCommand *)> &registrator,
+      FragmentController &controller,
+      ControllerOptions &ControllerInfo);
 
-void addSpecificOptions(
-    boost::program_options::options_description_easy_init option);
+  void addSpecificOptions(
+      boost::program_options::options_description_easy_init option);
 
-int addOtherParsings(
-    ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm,
-    const ControllerCommandRegistry &ControllerCommands);
-
+  int addOtherParsings(
+      ControllerOptions &ControllerInfo,
+      boost::program_options::variables_map &vm);
+};
 
 #endif /* CONTROLLER_MPQCCOMMANDJOB_HPP_ */
Index: src/controller_SystemCommandJob.cpp
===================================================================
--- src/controller_SystemCommandJob.cpp	(revision cbcbbd63e97a2e60704da03bab709f5377d591aa)
+++ src/controller_SystemCommandJob.cpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -64,14 +64,23 @@
 }
 
-ControllerOptions *allocateControllerInfo()
+inline std::vector<std::string> getListOfCommands(const ControllerCommandRegistry &ControllerCommands)
+{
+  std::vector<std::string> Commands;
+  for (ControllerCommandRegistry::const_iterator iter = ControllerCommands.getBeginIter();
+      iter != ControllerCommands.getEndIter(); ++iter)
+    Commands.push_back(iter->first);
+
+  return Commands;
+}
+
+ControllerOptions *controller_SystemCommandJob::allocateControllerInfo()
 {
   return new ControllerOptions_SystemCommandJob();
 }
 
-void addSpecificCommands(
+void controller_SystemCommandJob::addSpecificCommands(
     boost::function<void (ControllerCommand *)> &registrator,
     FragmentController &controller,
-    ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm)
+    ControllerOptions &ControllerInfo)
 {
   ControllerOptions_SystemCommandJob &CI =
@@ -92,5 +101,5 @@
 }
 
-void addSpecificOptions(
+void controller_SystemCommandJob::addSpecificOption(
     boost::program_options::options_description_easy_init option)
 {
@@ -101,8 +110,7 @@
 }
 
-int addOtherParsings(
+int controller_SystemCommandJob::addOtherParsings(
     ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm,
-    const ControllerCommandRegistry &ControllerCommands)
+    boost::program_options::variables_map &vm)
 {
   ControllerOptions_SystemCommandJob &CI =
Index: src/controller_SystemCommandJob.hpp
===================================================================
--- src/controller_SystemCommandJob.hpp	(revision cbcbbd63e97a2e60704da03bab709f5377d591aa)
+++ src/controller_SystemCommandJob.hpp	(revision 014bc488792ee58f26e7bf769da070ed1c146bfc)
@@ -17,4 +17,6 @@
 #include <boost/program_options.hpp>
 
+#include "controller_AddOn.hpp"
+
 class ControllerCommand;
 class ControllerCommandRegistry;
@@ -23,19 +25,20 @@
 class FragmentController;
 
-ControllerOptions *allocateControllerInfo();
+struct controller_SystemCommandJob : public controller_AddOn
+{
+  ControllerOptions *allocateControllerInfo();
 
-void addSpecificCommands(
-    boost::function<void (ControllerCommand *)> &registrator,
-    FragmentController &controller,
-    ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm);
+  void addSpecificCommands(
+      boost::function<void (ControllerCommand *)> &registrator,
+      FragmentController &controller,
+      ControllerOptions &ControllerInfo);
 
-void addSpecificOptions(
-    boost::program_options::options_description_easy_init option);
+  void addSpecificOptions(
+      boost::program_options::options_description_easy_init option);
 
-int addOtherParsings(
-    ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm,
-    const ControllerCommandRegistry &ControllerCommands);
+  int addOtherParsings(
+      ControllerOptions &ControllerInfo,
+      boost::program_options::variables_map &vm);
+};
 
 #endif /* CONTROLLER_SYSTEMCOMMANDJOB_HPP_ */
