Index: src/ControllerOptions.cpp
===================================================================
--- src/ControllerOptions.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/ControllerOptions.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+/*
+ * ControllerOptions.cpp
+ *
+ *  Created on: 01.06.2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "ControllerOptions.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+int ControllerOptions::parseServerPort(boost::program_options::variables_map &vm) {
+  if (vm.count("server")) {
+    server = vm["server"].as< std::string >();
+    serverport = server.substr(server.find_last_of(':')+1, std::string::npos);
+    server = server.substr(0, server.find_last_of(':'));
+    try {
+      boost::lexical_cast<size_t>(serverport);
+    } catch (boost::bad_lexical_cast &) {
+      ELOG(1, "Could not interpret " << serverport << " as server:port.");
+      return 255;
+    }
+    LOG(1, "INFO: Using " << server << ":" << serverport << " as server's address.");
+  } else {
+    ELOG(1, "Requiring server's address (host:port) to connect to.");
+    return 255;
+  }
+  return 0;
+}
+
+int ControllerOptions::parseCommand(boost::program_options::variables_map &vm, const std::vector<std::string> &Commands) {
+  if (!vm.count("command")) {
+    ELOG(1, "Controller requires one of the following commands: "+toString(Commands));
+    return 255;
+  }
+  command = vm["command"].as< std::string >();
+  return 0;
+}
+
Index: src/ControllerOptions.hpp
===================================================================
--- src/ControllerOptions.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/ControllerOptions.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,34 @@
+/*
+ * ControllerOptions.hpp
+ *
+ *  Created on: 01.06.2012
+ *      Author: heber
+ */
+
+#ifndef CONTROLLEROPTIONS_HPP_
+#define CONTROLLEROPTIONS_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/program_options.hpp>
+#include <string>
+
+#include "DefaultOptions.hpp"
+
+
+struct ControllerOptions : public DefaultOptions
+{
+  int parseServerPort(boost::program_options::variables_map &vm);
+  int parseCommand(boost::program_options::variables_map &vm, const std::vector<std::string> &Commands);
+
+  std::string command;
+  std::string server;
+  std::string serverport;
+
+};
+
+
+#endif /* CONTROLLEROPTIONS_HPP_ */
Index: src/ControllerOptions_MPQCCommandJob.cpp
===================================================================
--- src/ControllerOptions_MPQCCommandJob.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/ControllerOptions_MPQCCommandJob.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+/*
+ * ControllerOptions_MPQCCommandJob.cpp
+ *
+ *  Created on: Jun 6, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include "ControllerOptions_MPQCCommandJob.hpp"
+
+int ControllerOptions_MPQCCommandJob::parseFragmentpath(boost::program_options::variables_map &vm) {
+  if (command == "receivempqc") {
+    if (!vm.count("fragment-path")) {
+      ELOG(1, "'"+command+"' requires two options: [fragment-path].");
+      return 255;
+    }
+    fragmentpath = vm["fragment-path"].as< std::string >();
+  }
+  return 0;
+}
+
+int ControllerOptions_MPQCCommandJob::parseJobfiles(boost::program_options::variables_map &vm) {
+  if (command == "addjobs") {
+    if (!vm.count("jobfiles")) {
+      ELOG(1, "'"+command+"' requires two options: [executable] [jobfiles].");
+      return 255;
+    }
+    jobfiles = vm["jobfiles"].as< std::vector<std::string> >();
+  }
+  return 0;
+}
+
Index: src/ControllerOptions_MPQCCommandJob.hpp
===================================================================
--- src/ControllerOptions_MPQCCommandJob.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/ControllerOptions_MPQCCommandJob.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,34 @@
+/*
+ * ControllerOptions_MPQCCommandJob.hpp
+ *
+ *  Created on: Jun 6, 2012
+ *      Author: heber
+ */
+
+#ifndef CONTROLLEROPTIONS_MPQCCOMMANDJOB_HPP_
+#define CONTROLLEROPTIONS_MPQCCOMMANDJOB_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/program_options.hpp>
+#include <string>
+
+#include "ControllerOptions_SystemCommandJob.hpp"
+
+struct ControllerOptions_MPQCCommandJob : public ControllerOptions_SystemCommandJob
+{
+  int parseFragmentpath(boost::program_options::variables_map &vm);
+  int parseJobfiles(boost::program_options::variables_map &vm);
+
+  std::string fragmentpath;
+  std::vector<std::string> jobfiles;
+};
+
+
+
+
+#endif /* CONTROLLEROPTIONS_MPQCCOMMANDJOB_HPP_ */
Index: src/ControllerOptions_SystemCommandJob.cpp
===================================================================
--- src/ControllerOptions_SystemCommandJob.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/ControllerOptions_SystemCommandJob.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+/*
+ * ControllerOptions_SystemCommandJob.cpp
+ *
+ *  Created on: 01.06.2012
+ *      Author: heber
+
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include "ControllerOptions_SystemCommandJob.hpp"
+
+int ControllerOptions_SystemCommandJob::parseExecutable(boost::program_options::variables_map &vm) {
+  if ((command == "createjobs") || (command == "addjobs")) {
+    if (!vm.count("executable")) {
+      ELOG(1, "'"+command+"' requires two options: [executable] [jobcommand].");
+      return 255;
+    }
+    executable = vm["executable"].as< std::string >();
+  }
+  return 0;
+}
+
+int ControllerOptions_SystemCommandJob::parseJobCommand(boost::program_options::variables_map &vm) {
+  if (command == "createjobs") {
+    if (!vm.count("jobcommand")) {
+      ELOG(1, "'"+command+"' requires two options: [executable] [jobcommand].");
+      return 255;
+    }
+    jobcommand = vm["jobcommand"].as< std::string >();
+  }
+  return 0;
+}
Index: src/ControllerOptions_SystemCommandJob.hpp
===================================================================
--- src/ControllerOptions_SystemCommandJob.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/ControllerOptions_SystemCommandJob.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,30 @@
+/*
+ * ControllerOptions_SystemCommandJob.hpp
+ *
+ *  Created on: 01.06.2012
+ *      Author: heber
+ */
+
+#ifndef CONTROLLEROPTIONS_SYSTEMCOMMANDJOB_HPP_
+#define CONTROLLEROPTIONS_SYSTEMCOMMANDJOB_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/program_options.hpp>
+#include <string>
+
+#include "ControllerOptions.hpp"
+
+struct ControllerOptions_SystemCommandJob : public ControllerOptions
+{
+  int parseExecutable(boost::program_options::variables_map &vm);
+  int parseJobCommand(boost::program_options::variables_map &vm);
+
+  std::string executable;
+  std::string jobcommand;
+};
+
+#endif /* CONTROLLEROPTIONS_SYSTEMCOMMANDJOB_HPP_ */
Index: src/DefaultOptions.cpp
===================================================================
--- src/DefaultOptions.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/DefaultOptions.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+/*
+ * DefaultOptions.cpp
+ *
+ *  Created on: 01.06.2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "DefaultOptions.hpp"
+
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Verbose.hpp"
+
+int DefaultOptions::parseHelp(boost::program_options::variables_map &vm, const boost::program_options::options_description &desc) {
+  if (vm.count("help")) {
+    std::cout << desc << "\n";
+    return 1;
+  }
+  return 0;
+}
+int DefaultOptions::parseVerbosity(boost::program_options::variables_map &vm) {
+  if (vm.count("verbosity")) {
+    LOG(0, "STATUS: Verbosity level was set to " << vm["verbosity"].as<size_t>() << ".");
+    setVerbosity(vm["verbosity"].as<size_t>());
+  } else {
+    LOG(0, "STATUS: Verbosity level was not set, defaulting to 5.");
+    setVerbosity(5);
+  }
+  return 0;
+}
+
Index: src/DefaultOptions.hpp
===================================================================
--- src/DefaultOptions.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
+++ src/DefaultOptions.hpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -0,0 +1,26 @@
+/*
+ * DefaultOptions.hpp
+ *
+ *  Created on: 01.06.2012
+ *      Author: heber
+ */
+
+#ifndef DEFAULTOPTIONS_HPP_
+#define DEFAULTOPTIONS_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/program_options.hpp>
+#include <string>
+
+struct DefaultOptions
+{
+  int parseHelp(boost::program_options::variables_map &vm, const boost::program_options::options_description &desc);
+  int parseVerbosity(boost::program_options::variables_map &vm);
+};
+
+
+#endif /* DEFAULTOPTIONS_HPP_ */
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 0aaf84342d2a408836cb6f595bc543d391f96af5)
+++ src/Makefile.am	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -381,6 +381,6 @@
   Fragmentation/Automation/Pool/WorkerPool.hpp
 
-Controller_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) controller.cpp
-Controller_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
+Controller_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) controller.cpp DefaultOptions.cpp DefaultOptions.hpp ControllerOptions.cpp ControllerOptions.hpp ControllerOptions_MPQCCommandJob.cpp ControllerOptions_MPQCCommandJob.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)
 Controller_LDADD = \
Index: src/controller.cpp
===================================================================
--- src/controller.cpp	(revision 0aaf84342d2a408836cb6f595bc543d391f96af5)
+++ src/controller.cpp	(revision 5fa1f0d91ec5fcecb8e7f01bba8935242d296f10)
@@ -49,4 +49,5 @@
 #include "Fragmentation/Automation/Jobs/SystemCommandJob.hpp"
 #include "Fragmentation/Automation/Results/FragmentResult.hpp"
+#include "ControllerOptions_MPQCCommandJob.hpp"
 
 /** Print the status of scheduled and done jobs.
@@ -287,117 +288,4 @@
 }
 
-struct DefaultOptions
-{
-  int parseHelp(boost::program_options::variables_map &vm, const boost::program_options::options_description &desc) {
-    if (vm.count("help")) {
-      std::cout << desc << "\n";
-      return 1;
-    }
-    return 0;
-  }
-  int parseVerbosity(boost::program_options::variables_map &vm) {
-    if (vm.count("verbosity")) {
-      LOG(0, "STATUS: Verbosity level was set to " << vm["verbosity"].as<size_t>() << ".");
-      setVerbosity(vm["verbosity"].as<size_t>());
-    } else {
-      LOG(0, "STATUS: Verbosity level was not set, defaulting to 5.");
-      setVerbosity(5);
-    }
-    return 0;
-  }
-};
-
-struct ControllerOptions : public DefaultOptions
-{
-  int parseServerPort(boost::program_options::variables_map &vm) {
-    if (vm.count("server")) {
-      server = vm["server"].as< std::string >();
-      serverport = server.substr(server.find_last_of(':')+1, std::string::npos);
-      server = server.substr(0, server.find_last_of(':'));
-      try {
-        boost::lexical_cast<size_t>(serverport);
-      } catch (boost::bad_lexical_cast &) {
-        ELOG(1, "Could not interpret " << serverport << " as server:port.");
-        return 255;
-      }
-      LOG(1, "INFO: Using " << server << ":" << serverport << " as server's address.");
-    } else {
-      ELOG(1, "Requiring server's address (host:port) to connect to.");
-      return 255;
-    }
-    return 0;
-  }
-
-  int parseCommand(boost::program_options::variables_map &vm, const std::vector<std::string> &Commands) {
-    if (!vm.count("command")) {
-      ELOG(1, "Controller requires one of the following commands: "+toString(Commands));
-      return 255;
-    }
-    command = vm["command"].as< std::string >();
-    return 0;
-  }
-
-  std::string command;
-  std::string server;
-  std::string serverport;
-
-};
-
-struct ControllerOptions_SystemCommandJob : public ControllerOptions
-{
-  int parseExecutable(boost::program_options::variables_map &vm) {
-    if ((command == "createjobs") || (command == "addjobs")) {
-      if (!vm.count("executable")) {
-        ELOG(1, "'"+command+"' requires two options: [executable] [jobcommand].");
-        return 255;
-      }
-      executable = vm["executable"].as< std::string >();
-    }
-    return 0;
-  }
-
-  int parseJobCommand(boost::program_options::variables_map &vm) {
-    if (command == "createjobs") {
-      if (!vm.count("jobcommand")) {
-        ELOG(1, "'"+command+"' requires two options: [executable] [jobcommand].");
-        return 255;
-      }
-      jobcommand = vm["jobcommand"].as< std::string >();
-    }
-    return 0;
-  }
-
-  std::string executable;
-  std::string jobcommand;
-};
-
-struct ControllerOptions_MPQCCommandJob : public ControllerOptions_SystemCommandJob
-{
-  int parseFragmentpath(boost::program_options::variables_map &vm) {
-    if (command == "receivempqc") {
-      if (!vm.count("fragment-path")) {
-        ELOG(1, "'"+command+"' requires two options: [fragment-path].");
-        return 255;
-      }
-      fragmentpath = vm["fragment-path"].as< std::string >();
-    }
-    return 0;
-  }
-
-  int parseJobfiles(boost::program_options::variables_map &vm) {
-    if (command == "addjobs") {
-      if (!vm.count("jobfiles")) {
-        ELOG(1, "'"+command+"' requires two options: [executable] [jobfiles].");
-        return 255;
-      }
-      jobfiles = vm["jobfiles"].as< std::vector<std::string> >();
-    }
-    return 0;
-  }
-
-  std::string fragmentpath;
-  std::vector<std::string> jobfiles;
-};
-
 void creatingJob(FragmentController &controller, const ControllerOptions_SystemCommandJob &ControllerInfo)
 {
@@ -517,17 +405,23 @@
 
   // set controller information
-  ControllerInfo.parseHelp(vm, desc);
-  ControllerInfo.parseVerbosity(vm);
-  ControllerInfo.parseServerPort(vm);
-  ControllerInfo.parseCommand(vm, Commands);
+  int status = 0;
+  status = ControllerInfo.parseHelp(vm, desc);
+  if (status) return status;
+  status = ControllerInfo.parseVerbosity(vm);
+  if (status) return status;
+  status = ControllerInfo.parseServerPort(vm);
+  if (status) return status;
+  status = ControllerInfo.parseCommand(vm, Commands);
+  if (status) return status;
 
   // all later parse functions depend on parsed command
-  ControllerInfo.parseExecutable(vm);
-
-  ControllerInfo.parseJobCommand(vm);
-
-  ControllerInfo.parseFragmentpath(vm);
-
-  ControllerInfo.parseJobfiles(vm);
+  status = ControllerInfo.parseExecutable(vm);
+  if (status) return status;
+  status = ControllerInfo.parseJobCommand(vm);
+  if (status) return status;
+  status = ControllerInfo.parseFragmentpath(vm);
+  if (status) return status;
+  status = ControllerInfo.parseJobfiles(vm);
+  if (status) return status;
 
   // parse given ControllerCommand
