Index: src/Actions/Action_impl_header.hpp
===================================================================
--- src/Actions/Action_impl_header.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/Action_impl_header.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -18,4 +18,5 @@
 #include <boost/preprocessor/seq/seq.hpp>
 #include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/transform.hpp>
 
 // some derived names
@@ -24,5 +25,5 @@
 #define STATE BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, State))
 #define PARAMS BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters))
-
+#define PARAMSDOT BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters))
 
 // check if no lists given
@@ -79,7 +80,8 @@
 #define value_print(z,n,command) \
   ValueStorage::getInstance(). command (\
+  BOOST_PP_SEQ_ELEM(n, tokens)\
+  , \
+  params.\
   BOOST_PP_SEQ_ELEM(n, references)\
-  , \
-  BOOST_PP_SEQ_ELEM(n, tokens)\
   );
 
@@ -106,5 +108,13 @@
   virtual const std::string getName();
 
-  struct PARAMS;
+  struct PARAMS : ActionParameters {
+  #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0)
+  #define BOOST_PP_LOCAL_MACRO(n) type_print(~, n, ;)
+  #define BOOST_PP_LOCAL_LIMITS  (0, MAXNOTOKENS-1)
+  #include BOOST_PP_LOCAL_ITERATE()
+  #undef BOOST_PP_LOCAL_MACRO
+  #undef BOOST_PP_LOCAL_LIMITS
+  #endif
+  } params;
 
 protected:
@@ -119,2 +129,15 @@
 };
 
+#undef types
+#undef tokens
+#undef references
+#undef MAXNOTOKENS
+
+#undef ACTION
+#undef ACTIONNAME
+#undef CATEGORY
+#undef COMMAND
+#undef COMMANDFULL
+#undef PARAMS
+#undef STATE
+#undef TOKEN
Index: src/Actions/Action_impl_post.hpp
===================================================================
--- src/Actions/Action_impl_post.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ 	(revision )
@@ -1,15 +1,0 @@
-/*
- * Action_impl_post.hpp
- *
- *  Created on: Aug 25, 2010
- *      Author: heber
- */
-
-#undef ACTION
-#undef ACTIONNAME
-#undef CATEGORY
-#undef COMMAND
-#undef COMMANDFULL
-#undef PARAMS
-#undef STATE
-#undef TOKEN
Index: src/Actions/Action_impl_pre.hpp
===================================================================
--- src/Actions/Action_impl_pre.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/Action_impl_pre.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -23,7 +23,98 @@
  */
 
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/comparison/equal.hpp>
+#include <boost/preprocessor/comparison/not_equal.hpp>
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/debug/assert.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/seq/elem.hpp>
+#include <boost/preprocessor/seq/push_back.hpp>
+#include <boost/preprocessor/seq/seq.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/transform.hpp>
+
+// some derived names
+#define ACTION BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Action))
+#define COMMAND BOOST_PP_CAT(CATEGORY, ACTIONNAME)
+#define STATE BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, State))
+#define PARAMS BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters))
+#define PARAMSDOT BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters))
+
+// check if no lists given
+#ifndef types
+#define MAXNOTOKENS 0
+#else
+#define MAXNOTOKENS BOOST_PP_SEQ_SIZE(types)
+#endif
+
+// check user has given name and category
+#ifndef CATEGORY
+ERROR: No "CATEGORY" defined in: __FILE__
+#endif
+
+#ifndef ACTIONNAME
+ERROR: No "ACTIONNAME" defined in: __FILE__
+#endif
+
+// calculate numbers and check whether all have same size
+#ifdef tokens
+BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXNOTOKENS, BOOST_PP_SEQ_SIZE(tokens)),\
+  ERROR: There are not the same number of "tokens" and "types" in: __FILE__ \
+)
+#endif
+#ifdef references
+BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXNOTOKENS, BOOST_PP_SEQ_SIZE(references)),\
+  ERROR: There are not the same number of "tokens" and "references" in: __FILE__ \
+)
+#endif
+
+// print a list of type ref followed by a separator, i.e. "int i;"
+#define type_print(z,n,separator) \
+  BOOST_PP_SEQ_ELEM(n, types) \
+  BOOST_PP_SEQ_ELEM(n, references)\
+  separator
+
+// print a list of type ref followed, i.e. "int i, double position"
+#define type_list(z,n,unused) \
+  BOOST_PP_COMMA_IF(n)\
+  BOOST_PP_SEQ_ELEM(n, types) \
+  BOOST_PP_SEQ_ELEM(n, references)
+
+// prints dialog->query calls for types with tokens
+#define dialog_print(z,n,unused) \
+  dialog->query<\
+  BOOST_PP_SEQ_ELEM(n, types)\
+  >(\
+  BOOST_PP_SEQ_ELEM(n, tokens)\
+  , ValueStorage::getInstance().getDescription(\
+  BOOST_PP_SEQ_ELEM(n, tokens)\
+  ));
+
+// prints set/queryCurrentValue (command) for paramreferences and paramtokens
+#define value_print(z,n,command, prefix) \
+  ValueStorage::getInstance(). command (\
+  BOOST_PP_SEQ_ELEM(n, tokens)\
+  , \
+  prefix\
+  BOOST_PP_SEQ_ELEM(n, references)\
+  );
+
+#if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0)
+#define COMMANDFULL \
+void COMMAND( \
+BOOST_PP_REPEAT(MAXNOTOKENS, type_list, ~) \
+)
+# else
+#define COMMANDFULL void COMMAND()
+#endif
+
 #include "Actions/ActionRegistry.hpp"
 #include "UIElements/Dialog.hpp"
 #include "Actions/ValueStorage.hpp"
+
 
 const char ACTION::NAME[] = TOKEN;
@@ -52,7 +143,10 @@
 };
 
-struct PARAMS : ActionParameters {
+COMMANDFULL
+{
+  ACTION::PARAMS params;
+  Action *ToCall = ActionRegistry::getInstance().getActionByName( ACTION::NAME ); //->clone(params);
 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0)
-#define BOOST_PP_LOCAL_MACRO(n) type_print(~, n, ;)
+#define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, setCurrentValue, )
 #define BOOST_PP_LOCAL_LIMITS  (0, MAXNOTOKENS-1)
 #include BOOST_PP_LOCAL_ITERATE()
@@ -60,21 +154,10 @@
 #undef BOOST_PP_LOCAL_LIMITS
 #endif
+  ToCall->call(Action::NonInteractive);
 };
 
-COMMANDFULL
-{
+void ACTION::getParametersfromValueStorage() {
 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0)
-#define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, setCurrentValue)
-#define BOOST_PP_LOCAL_LIMITS  (0, MAXNOTOKENS-1)
-#include BOOST_PP_LOCAL_ITERATE()
-#undef BOOST_PP_LOCAL_MACRO
-#undef BOOST_PP_LOCAL_LIMITS
-#endif
-        ActionRegistry::getInstance().getActionByName( ACTION::NAME )->call(Action::NonInteractive);
-};
-
-void AnalysisMolecularVolumeAction::getParametersfromValueStorage() {
-#if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0)
-#define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, queryCurrentValue)
+#define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, queryCurrentValue, params.)
 #define BOOST_PP_LOCAL_LIMITS  (0, MAXNOTOKENS-1)
 #include BOOST_PP_LOCAL_ITERATE()
@@ -89,2 +172,10 @@
 #undef MAXNOTOKENS
 
+#undef ACTION
+#undef ACTIONNAME
+#undef CATEGORY
+#undef COMMAND
+#undef COMMANDFULL
+#undef PARAMS
+#undef STATE
+#undef TOKEN
Index: src/Actions/AnalysisAction/MolecularVolumeAction.cpp
===================================================================
--- src/Actions/AnalysisAction/MolecularVolumeAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/MolecularVolumeAction.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -37,8 +37,9 @@
 
 // and construct the stuff
+#include "MolecularVolumeAction.def"
 #include "Action_impl_pre.hpp"
 
 /** =========== define the function ====================== */
-Action::state_ptr ACTION::performCall() {
+Action::state_ptr AnalysisMolecularVolumeAction::performCall() {
   // obtain information
   getParametersfromValueStorage();
@@ -66,25 +67,22 @@
 }
 
-Action::state_ptr ACTION::performUndo(Action::state_ptr _state) {
+Action::state_ptr AnalysisMolecularVolumeAction::performUndo(Action::state_ptr _state) {
   return Action::success;
 }
 
-Action::state_ptr ACTION::performRedo(Action::state_ptr _state){
+Action::state_ptr AnalysisMolecularVolumeAction::performRedo(Action::state_ptr _state){
   return Action::success;
 }
 
-bool ACTION::canUndo() {
+bool AnalysisMolecularVolumeAction::canUndo() {
   return true;
 }
 
-bool ACTION::shouldUndo() {
+bool AnalysisMolecularVolumeAction::shouldUndo() {
   return true;
 }
 
-const string ACTION::getName() {
+const string AnalysisMolecularVolumeAction::getName() {
   return NAME;
 }
 /** =========== end of function ====================== */
-
-// and clean the stuff
-#include "Action_impl_post.hpp"
Index: src/Actions/AnalysisAction/MolecularVolumeAction.def
===================================================================
--- src/Actions/AnalysisAction/MolecularVolumeAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
+++ src/Actions/AnalysisAction/MolecularVolumeAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -0,0 +1,21 @@
+/*
+ * MolecularVolumeAction.def
+ *
+ *  Created on: Aug 25, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+//#define types (int)
+//#define references (molID)
+//#define tokens (NAME)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Analysis
+#define ACTIONNAME MolecularVolume
+#define TOKEN "molecular-volume"
+
Index: src/Actions/AnalysisAction/MolecularVolumeAction.hpp
===================================================================
--- src/Actions/AnalysisAction/MolecularVolumeAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/MolecularVolumeAction.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -16,16 +16,6 @@
 #include "Actions/Action.hpp"
 
-// i.e. there is an integer with variable name Z that can be found in
-// ValueStorage by the token "Z" -> first column: int, Z, "Z"
-// "undefine" if no parameters are required
-//#define types (int)
-//#define references (molID)
-//#define tokens (NAME)
-// some defines for all the names, you may use ACTION, STATE and PARAMS
-#define CATEGORY Analysis
-#define ACTIONNAME MolecularVolume
-#define TOKEN "molecular-volume"
-
-#include "Action_impl_header.hpp"
+#include "MolecularVolumeAction.def"
+#include "Actions/Action_impl_header.hpp"
 
 #endif /* MOLECULARVOLUMEACTION_HPP_ */
Index: src/Actions/AnalysisAction/PairCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "analysis_correlation.hpp"
 #include "boundary.hpp"
@@ -38,81 +36,32 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
 
-const char AnalysisPairCorrelationAction::NAME[] = "pair-correlation";
+// and construct the stuff
+#include "PairCorrelationAction.def"
+#include "Action_impl_pre.hpp"
 
-AnalysisPairCorrelationAction::AnalysisPairCorrelationAction() :
-  Action(NAME)
-{}
-
-AnalysisPairCorrelationAction::~AnalysisPairCorrelationAction()
-{}
-
-void AnalysisPairCorrelation(std::vector< element *> &elements, double BinStart, double BinWidth, double BinEnd, string &outputname, string &binoutputname, bool periodic) {
-  ValueStorage::getInstance().setCurrentValue("elements", elements);
-  ValueStorage::getInstance().setCurrentValue("bin-start", BinStart);
-  ValueStorage::getInstance().setCurrentValue("bin-width", BinWidth);
-  ValueStorage::getInstance().setCurrentValue("bin-end", BinEnd);
-  ValueStorage::getInstance().setCurrentValue("output-file", outputname);
-  ValueStorage::getInstance().setCurrentValue("bin-output-file", binoutputname);
-  ValueStorage::getInstance().setCurrentValue("periodic", periodic);
-  ActionRegistry::getInstance().getActionByName(AnalysisPairCorrelationAction::NAME)->call(Action::NonInteractive);
-};
-
-
-void AnalysisPairCorrelationAction::getParametersfromValueStorage()
-{};
-
-Dialog* AnalysisPairCorrelationAction::fillDialog(Dialog* dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements"));
-  dialog->queryDouble("bin-start", ValueStorage::getInstance().getDescription("bin-start"));
-  dialog->queryDouble("bin-width", ValueStorage::getInstance().getDescription("bin-width"));
-  dialog->queryDouble("bin-end", ValueStorage::getInstance().getDescription("bin-end"));
-  dialog->queryString("output-file", ValueStorage::getInstance().getDescription("output-file"));
-  dialog->queryString("bin-output-file", ValueStorage::getInstance().getDescription("bin-output-file"));
-  dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic"));
-
-  return dialog;
-}
-
+/** =========== define the function ====================== */
 Action::state_ptr AnalysisPairCorrelationAction::performCall() {
   int ranges[3] = {1, 1, 1};
-  double BinEnd = 0.;
-  double BinStart = 0.;
-  double BinWidth = 0.;
-  string outputname;
-  string binoutputname;
-  bool periodic;
   ofstream output;
   ofstream binoutput;
-  std::vector<const element *> elements;
   string type;
-  Vector Point;
   BinPairMap *binmap = NULL;
 
   // obtain information
-  ValueStorage::getInstance().queryCurrentValue("elements", elements);
-  ValueStorage::getInstance().queryCurrentValue("bin-start", BinStart);
-  ValueStorage::getInstance().queryCurrentValue("bin-width", BinWidth);
-  ValueStorage::getInstance().queryCurrentValue("bin-end", BinEnd);
-  ValueStorage::getInstance().queryCurrentValue("output-file", outputname);
-  ValueStorage::getInstance().queryCurrentValue("bin-output-file", binoutputname);
-  ValueStorage::getInstance().queryCurrentValue("periodic", periodic);
+  getParametersfromValueStorage();
 
   // execute action
-  output.open(outputname.c_str());
-  binoutput.open(binoutputname.c_str());
+  output.open(params.outputname.c_str());
+  binoutput.open(params.binoutputname.c_str());
   PairCorrelationMap *correlationmap = NULL;
   std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
-  if (periodic)
-    correlationmap = PeriodicPairCorrelation(molecules, elements, ranges);
+  if (params.periodic)
+    correlationmap = PeriodicPairCorrelation(molecules, params.elements, ranges);
   else
-    correlationmap = PairCorrelation(molecules, elements);
+    correlationmap = PairCorrelation(molecules, params.elements);
   OutputPairCorrelation(&output, correlationmap);
-  binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
+  binmap = BinData( correlationmap, params.BinWidth, params.BinStart, params.BinEnd );
   OutputCorrelation ( &binoutput, binmap );
   delete(binmap);
@@ -142,2 +91,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/AnalysisAction/PairCorrelationAction.def
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
+++ src/Actions/AnalysisAction/PairCorrelationAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -0,0 +1,23 @@
+/*
+ * PairCorrelationAction.def
+ *
+ *  Created on: Aug 25, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <string>
+#include <vector>
+class element;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define types (std::vector<const element *>)(double)(double)(double)(std::string)(std::string)(bool)
+#define references (elements)(BinStart)(BinWidth)(BinEnd)(outputname)(binoutputname)(periodic)
+#define tokens ("elements")("bin-start")("bin-width")("bin-end")("output-file")("bin-output-file")("periodic")
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Analysis
+#define ACTIONNAME PairCorrelation
+#define TOKEN "pair-correlation"
Index: src/Actions/AnalysisAction/PairCorrelationAction.hpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/PairCorrelationAction.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -15,31 +15,7 @@
 
 #include "Actions/Action.hpp"
-#include <string>
-#include <vector>
 
-class element;
-
-void AnalysisPairCorrelation(std::vector< element *> &elements, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic);
-
-class AnalysisPairCorrelationAction : public Action {
-  friend void AnalysisPairCorrelation(std::vector< element *> &elements, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic);
-public:
-  AnalysisPairCorrelationAction();
-  virtual ~AnalysisPairCorrelationAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog*);
-private:
-   virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "PairCorrelationAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* PAIRCORRELATIONACTION_HPP_ */
Index: src/Actions/AnalysisAction/PointCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PointCorrelationAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/PointCorrelationAction.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/AnalysisAction/PointCorrelationAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "analysis_correlation.hpp"
 #include "boundary.hpp"
@@ -39,86 +37,36 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/AnalysisAction/PointCorrelationAction.hpp"
 
-const char AnalysisPointCorrelationAction::NAME[] = "point-correlation";
 
-AnalysisPointCorrelationAction::AnalysisPointCorrelationAction() :
-  Action(NAME)
-{}
+// and construct the stuff
+#include "PointCorrelationAction.def"
+#include "Action_impl_pre.hpp"
 
-AnalysisPointCorrelationAction::~AnalysisPointCorrelationAction()
-{}
-
-void AnalysisPointCorrelation(std::vector< element *> &elements, Vector &position, double BinStart, double BinWidth, double BinEnd, string &outputname, string &binoutputname, bool periodic) {
-  ValueStorage::getInstance().setCurrentValue("elements", elements);
-  ValueStorage::getInstance().setCurrentValue("position", position);
-  ValueStorage::getInstance().setCurrentValue("bin-start", BinStart);
-  ValueStorage::getInstance().setCurrentValue("bin-width", BinWidth);
-  ValueStorage::getInstance().setCurrentValue("bin-end", BinEnd);
-  ValueStorage::getInstance().setCurrentValue("output-file", outputname);
-  ValueStorage::getInstance().setCurrentValue("bin-output-file", binoutputname);
-  ValueStorage::getInstance().setCurrentValue("periodic", periodic);
-  ActionRegistry::getInstance().getActionByName(AnalysisPointCorrelationAction::NAME)->call(Action::NonInteractive);
-};
-
-void AnalysisPointCorrelationAction::getParametersfromValueStorage()
-{};
-
-Dialog* AnalysisPointCorrelationAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryVector("position", false, ValueStorage::getInstance().getDescription("position"));
-  dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements"));
-  dialog->queryDouble("bin-start", ValueStorage::getInstance().getDescription("bin-start"));
-  dialog->queryDouble("bin-width", ValueStorage::getInstance().getDescription("bin-width"));
-  dialog->queryDouble("bin-end", ValueStorage::getInstance().getDescription("bin-end"));
-  dialog->queryString("output-file", ValueStorage::getInstance().getDescription("output-file"));
-  dialog->queryString("bin-output-file", ValueStorage::getInstance().getDescription("bin-output-file"));
-  dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic"));
-
-  return dialog;
-}
-
+/** =========== define the function ====================== */
 Action::state_ptr AnalysisPointCorrelationAction::performCall() {
   int ranges[3] = {1, 1, 1};
-  double BinEnd = 0.;
-  double BinStart = 0.;
-  double BinWidth = 0.;
-  string outputname;
-  string binoutputname;
-  bool periodic;
   ofstream output;
   ofstream binoutput;
-  std::vector<const element *> elements;
   string type;
-  Vector Point;
   BinPairMap *binmap = NULL;
 
   // obtain information
-  ValueStorage::getInstance().queryCurrentValue("position", Point);
-  ValueStorage::getInstance().queryCurrentValue("elements", elements);
-  ValueStorage::getInstance().queryCurrentValue("bin-start", BinStart);
-  ValueStorage::getInstance().queryCurrentValue("bin-width", BinWidth);
-  ValueStorage::getInstance().queryCurrentValue("bin-end", BinEnd);
-  ValueStorage::getInstance().queryCurrentValue("output-file", outputname);
-  ValueStorage::getInstance().queryCurrentValue("bin-output-file", binoutputname);
-  ValueStorage::getInstance().queryCurrentValue("periodic", periodic);
+  getParametersfromValueStorage();
 
   // execute action
-  output.open(outputname.c_str());
-  binoutput.open(binoutputname.c_str());
-  cout << "Point to correlate to is  " << Point << endl;
+  output.open(params.outputname.c_str());
+  binoutput.open(params.binoutputname.c_str());
+  cout << "Point to correlate to is  " << params.Point << endl;
   CorrelationToPointMap *correlationmap = NULL;
-  for(std::vector<const element *>::iterator iter = elements.begin(); iter != elements.end(); ++iter)
+  for(std::vector<const element *>::iterator iter = params.elements.begin(); iter != params.elements.end(); ++iter)
     cout << "element is " << (*iter)->getSymbol() << endl;
   std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
-  if (periodic)
-    correlationmap  = PeriodicCorrelationToPoint(molecules, elements, &Point, ranges);
+  if (params.periodic)
+    correlationmap  = PeriodicCorrelationToPoint(molecules, params.elements, &params.Point, ranges);
   else
-    correlationmap = CorrelationToPoint(molecules, elements, &Point);
+    correlationmap = CorrelationToPoint(molecules, params.elements, &params.Point);
   OutputCorrelationToPoint(&output, correlationmap);
-  binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
+  binmap = BinData( correlationmap, params.BinWidth, params.BinStart, params.BinEnd );
   OutputCorrelation ( &binoutput, binmap );
   delete(binmap);
@@ -148,2 +96,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/AnalysisAction/PointCorrelationAction.def
===================================================================
--- src/Actions/AnalysisAction/PointCorrelationAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
+++ src/Actions/AnalysisAction/PointCorrelationAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -0,0 +1,25 @@
+/*
+ * PointCorrelationAction.def
+ *
+ *  Created on: Aug 25, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include "LinearAlgebra/Vector.hpp"
+#include <vector>
+#include <string>
+
+class element;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define types (std::vector<const element *>)(Vector)(double)(double)(double)(std::string)(std::string)(bool)
+#define references (elements)(Point)(BinStart)(BinWidth)(BinEnd)(outputname)(binoutputname)(periodic)
+#define tokens ("elements")("position")("bin-start")("bin-width")("bin-end")("output-file")("bin-output-file")("periodic")
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Analysis
+#define ACTIONNAME PointCorrelation
+#define TOKEN "point-correlation"
Index: src/Actions/AnalysisAction/PointCorrelationAction.hpp
===================================================================
--- src/Actions/AnalysisAction/PointCorrelationAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/PointCorrelationAction.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -15,33 +15,7 @@
 
 #include "Actions/Action.hpp"
-#include "LinearAlgebra/Vector.hpp"
-#include <vector>
-#include <string>
 
-class element;
-
-void AnalysisPointCorrelation(std::vector< element *> &elements, Vector &position, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic);
-
-class AnalysisPointCorrelationAction : public Action {
-  friend void AnalysisPointCorrelation(std::vector< element *> &elements, Vector &position, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic);
-
-public:
-  AnalysisPointCorrelationAction();
-  virtual ~AnalysisPointCorrelationAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog*);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "PointCorrelationAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* POINTCORRELATIONACTION_HPP_ */
Index: src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
@@ -34,37 +32,14 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
 
-const char AnalysisPrincipalAxisSystemAction::NAME[] = "principal-axis-system";
+// and construct the stuff
+#include "PrincipalAxisSystemAction.def"
+#include "Action_impl_pre.hpp"
 
-AnalysisPrincipalAxisSystemAction::AnalysisPrincipalAxisSystemAction() :
-  Action(NAME)
-{}
-
-AnalysisPrincipalAxisSystemAction::~AnalysisPrincipalAxisSystemAction()
-{}
-
-void AnalysisPrincipalAxisSystem() {
-  ActionRegistry::getInstance().getActionByName(AnalysisPrincipalAxisSystemAction::NAME)->call(Action::NonInteractive);
-};
-
-void AnalysisPrincipalAxisSystemAction::getParametersfromValueStorage()
-{};
-
-Dialog* AnalysisPrincipalAxisSystemAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+/** =========== define the function ====================== */
 Action::state_ptr AnalysisPrincipalAxisSystemAction::performCall() {
-  molecule *mol = NULL;
   Matrix InertiaTensor;
 
-  ValueStorage::getInstance().queryCurrentValue(NAME, mol);
   DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl);
   for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
@@ -115,2 +90,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/AnalysisAction/PrincipalAxisSystemAction.def
===================================================================
--- src/Actions/AnalysisAction/PrincipalAxisSystemAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
+++ src/Actions/AnalysisAction/PrincipalAxisSystemAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -0,0 +1,17 @@
+/*
+ * PrincipalAxisSystemAction.def
+ *
+ *  Created on: Aug 25, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Analysis
+#define ACTIONNAME PrincipalAxisSystem
+#define TOKEN "principal-axis-system"
Index: src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
===================================================================
--- src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -11,27 +11,6 @@
 #include "Actions/Action.hpp"
 
-void AnalysisPrincipalAxisSystem();
-
-class AnalysisPrincipalAxisSystemAction : public Action {
-  friend void AnalysisPrincipalAxisSystem();
-
-public:
-  AnalysisPrincipalAxisSystemAction();
-  virtual ~AnalysisPrincipalAxisSystemAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog *);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "PrincipalAxisSystemAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* PRINCIPALAXISSYSTEMACTION_HPP_ */
Index: src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/AnalysisAction/SurfaceCorrelationAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "analysis_correlation.hpp"
 #include "boundary.hpp"
@@ -39,83 +37,30 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/AnalysisAction/SurfaceCorrelationAction.hpp"
 
-const char AnalysisSurfaceCorrelationAction::NAME[] = "surface-correlation";
+// and construct the stuff
+#include "SurfaceCorrelationAction.def"
+#include "Action_impl_pre.hpp"
 
-AnalysisSurfaceCorrelationAction::AnalysisSurfaceCorrelationAction() :
-  Action(NAME)
-{}
-
-AnalysisSurfaceCorrelationAction::~AnalysisSurfaceCorrelationAction()
-{}
-
-void AnalysisSurfaceCorrelation(std::vector< element *> &elements, molecule *mol, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic) {
-  ValueStorage::getInstance().setCurrentValue("elements", elements);
-  ValueStorage::getInstance().setCurrentValue("molecule-by-id", mol);
-  ValueStorage::getInstance().setCurrentValue("bin-start", BinStart);
-  ValueStorage::getInstance().setCurrentValue("bin-width", BinWidth);
-  ValueStorage::getInstance().setCurrentValue("bin-end", BinEnd);
-  ValueStorage::getInstance().setCurrentValue("output-file", outputname);
-  ValueStorage::getInstance().setCurrentValue("bin-output-file", binoutputname);
-  ValueStorage::getInstance().setCurrentValue("periodic", periodic);
-  ActionRegistry::getInstance().getActionByName(AnalysisSurfaceCorrelationAction::NAME)->call(Action::NonInteractive);
-};
-
-
-void AnalysisSurfaceCorrelationAction::getParametersfromValueStorage()
-{};
-
-Dialog* AnalysisSurfaceCorrelationAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryMolecule("molecule-by-id", ValueStorage::getInstance().getDescription("molecule-by-id"));
-  dialog->queryElements("elements", ValueStorage::getInstance().getDescription("elements"));
-  dialog->queryDouble("bin-start", ValueStorage::getInstance().getDescription("bin-start"));
-  dialog->queryDouble("bin-width", ValueStorage::getInstance().getDescription("bin-width"));
-  dialog->queryDouble("bin-end", ValueStorage::getInstance().getDescription("bin-end"));
-  dialog->queryString("output-file", ValueStorage::getInstance().getDescription("output-file"));
-  dialog->queryString("bin-output-file", ValueStorage::getInstance().getDescription("bin-output-file"));
-  dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic"));
-
-  return dialog;
-}
-
+/** =========== define the function ====================== */
 Action::state_ptr AnalysisSurfaceCorrelationAction::performCall() {
   int ranges[3] = {1, 1, 1};
-  double BinEnd = 0.;
-  double BinStart = 0.;
-  double BinWidth = 0.;
-  molecule *Boundary = NULL;
-  string outputname;
-  string binoutputname;
-  bool periodic;
   ofstream output;
   ofstream binoutput;
-  std::vector<const element *> elements;
   string type;
-  Vector Point;
   BinPairMap *binmap = NULL;
 
   // obtain information
-  ValueStorage::getInstance().queryCurrentValue("molecule-by-id", Boundary);
-  ValueStorage::getInstance().queryCurrentValue("elements", elements);
-  ValueStorage::getInstance().queryCurrentValue("bin-start", BinStart);
-  ValueStorage::getInstance().queryCurrentValue("bin-width", BinWidth);
-  ValueStorage::getInstance().queryCurrentValue("bin-end", BinEnd);
-  ValueStorage::getInstance().queryCurrentValue("output-file", outputname);
-  ValueStorage::getInstance().queryCurrentValue("bin-output-file", binoutputname);
-  ValueStorage::getInstance().queryCurrentValue("periodic", periodic);
+  getParametersfromValueStorage();
 
   // execute action
-  output.open(outputname.c_str());
-  binoutput.open(binoutputname.c_str());
-  ASSERT(Boundary != NULL, "No molecule specified for SurfaceCorrelation.");
+  output.open(params.outputname.c_str());
+  binoutput.open(params.binoutputname.c_str());
+  ASSERT(params.Boundary != NULL, "No molecule specified for SurfaceCorrelation.");
   const double radius = 4.;
   double LCWidth = 20.;
-  if (BinEnd > 0) {
-    if (BinEnd > 2.*radius)
-      LCWidth = BinEnd;
+  if (params.BinEnd > 0) {
+    if (params.BinEnd > 2.*radius)
+      LCWidth = params.BinEnd;
     else
       LCWidth = 2.*radius;
@@ -128,11 +73,11 @@
   std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
   std::cout << "There are " << molecules.size() << " selected molecules." << std::endl;
-  LCList = new LinkedCell(Boundary, LCWidth);
-  FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
+  LCList = new LinkedCell(params.Boundary, LCWidth);
+  FindNonConvexBorder(params.Boundary, TesselStruct, LCList, radius, NULL);
   CorrelationToSurfaceMap *surfacemap = NULL;
-  if (periodic)
-    surfacemap = PeriodicCorrelationToSurface( molecules, elements, TesselStruct, LCList, ranges);
+  if (params.periodic)
+    surfacemap = PeriodicCorrelationToSurface( molecules, params.elements, TesselStruct, LCList, ranges);
   else
-    surfacemap = CorrelationToSurface( molecules, elements, TesselStruct, LCList);
+    surfacemap = CorrelationToSurface( molecules, params.elements, TesselStruct, LCList);
   delete LCList;
   OutputCorrelationToSurface(&output, surfacemap);
@@ -144,5 +89,5 @@
       DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl);
   }
-  binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
+  binmap = BinData( surfacemap, params.BinWidth, params.BinStart, params.BinEnd );
   OutputCorrelation ( &binoutput, binmap );
   delete TesselStruct;  // surfacemap contains refs to triangles! delete here, not earlier!
@@ -173,2 +118,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
Index: src/Actions/AnalysisAction/SurfaceCorrelationAction.def
===================================================================
--- src/Actions/AnalysisAction/SurfaceCorrelationAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
+++ src/Actions/AnalysisAction/SurfaceCorrelationAction.def	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -0,0 +1,24 @@
+/*
+ * SurfaceCorrelationAction.def
+ *
+ *  Created on: Aug 25, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <string>
+#include <vector>
+class element;
+class molecule;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required
+#define types (std::vector<const element *>)(molecule *)(double)(double)(double)(std::string)(std::string)(bool)
+#define references (elements)(Boundary)(BinStart)(BinWidth)(BinEnd)(outputname)(binoutputname)(periodic)
+#define tokens ("elements")("molecule-by-id")("bin-start")("bin-width")("bin-end")("output-file")("bin-output-file")("periodic")
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Analysis
+#define ACTIONNAME SurfaceCorrelation
+#define TOKEN "surface-correlation"
Index: src/Actions/AnalysisAction/SurfaceCorrelationAction.hpp
===================================================================
--- src/Actions/AnalysisAction/SurfaceCorrelationAction.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/AnalysisAction/SurfaceCorrelationAction.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -10,32 +10,7 @@
 
 #include "Actions/Action.hpp"
-#include <string>
-#include <vector>
 
-class element;
-class molecule;
-
-void AnalysisSurfaceCorrelation(std::vector< element *> &elements, molecule *mol, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic);
-
-class AnalysisSurfaceCorrelationAction : public Action {
-  friend void AnalysisSurfaceCorrelation(std::vector< element *> &elements, molecule *mol, double BinStart, double BinWidth, double BinEnd, std::string &outputname, std::string &binoutputname, bool periodic);
-public:
-  AnalysisSurfaceCorrelationAction();
-  virtual ~AnalysisSurfaceCorrelationAction();
-
-  bool canUndo();
-  bool shouldUndo();
-
-  virtual const std::string getName();
-protected:
-  virtual Dialog * fillDialog(Dialog*);
-private:
-  virtual void getParametersfromValueStorage();
-  virtual Action::state_ptr performCall();
-  virtual Action::state_ptr performUndo(Action::state_ptr);
-  virtual Action::state_ptr performRedo(Action::state_ptr);
-
-  static const char NAME[];
-};
+#include "SurfaceCorrelationAction.def"
+#include "Action_impl_header.hpp"
 
 #endif /* SURFACECORRELATIONACTION_HPP_ */
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/Makefile.am	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -200,5 +200,7 @@
 lib_LTLIBRARIES = libMolecuilderActions-@MOLECUILDER_API_VERSION@.la
 libMolecuilderActions_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
-libMolecuilderActions_libs = ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la
+libMolecuilderActions_libs = \
+	../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
+	../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la
 nobase_libMolecuilderActions_include_HEADERS = ${ACTIONSHEADER}
 
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Makefile.am	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -324,4 +324,5 @@
 joiner_SOURCES = joiner.cpp datacreator.cpp datacreator.hpp periodentafel.hpp
 joiner_LDADD = \
+	UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
 	Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
 	libMolecuilder-@MOLECUILDER_API_VERSION@.la \
@@ -336,4 +337,5 @@
 analyzer_SOURCES = analyzer.cpp datacreator.cpp periodentafel.hpp datacreator.hpp 
 analyzer_LDADD = \
+	UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
 	Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
 	libMolecuilder-@MOLECUILDER_API_VERSION@.la \
Index: src/UIElements/Dialog.cpp
===================================================================
--- src/UIElements/Dialog.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/UIElements/Dialog.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -25,9 +25,9 @@
 #include "Helpers/Verbose.hpp"
 #include "atom.hpp"
+#include "Box.hpp"
 #include "element.hpp"
 #include "molecule.hpp"
 #include "LinearAlgebra/Vector.hpp"
 #include "LinearAlgebra/Matrix.hpp"
-#include "Box.hpp"
 
 using namespace std;
@@ -84,4 +84,89 @@
 }
 
+template <> void Dialog::query<void *>(const char *token, std::string description)
+{
+  queryEmpty(token, description);
+}
+
+template <> void Dialog::query<bool>(const char *token, std::string description)
+{
+  queryBoolean(token, description);
+}
+
+template <> void Dialog::query<int>(const char *token, std::string description)
+{
+  queryInt(token, description);
+}
+
+template <> void Dialog::query< std::vector<int> >(const char *token, std::string description)
+{
+  queryInts(token, description);
+}
+
+template <> void Dialog::query<double>(const char *token, std::string description)
+{
+  queryDouble(token, description);
+}
+
+template <> void Dialog::query< std::vector<double> >(const char *token, std::string description)
+{
+  queryDoubles(token, description);
+}
+
+template <> void Dialog::query<std::string>(const char *token, std::string description)
+{
+  queryString(token, description);
+}
+
+template <> void Dialog::query< std::vector<std::string> >(const char *token, std::string description)
+{
+  queryStrings(token, description);
+}
+
+template <> void Dialog::query<atom *>(const char *token, std::string description)
+{
+  queryAtom(token, description);
+}
+
+template <> void Dialog::query< std::vector<atom *> >(const char *token, std::string description)
+{
+  queryAtoms(token, description);
+}
+
+template <> void Dialog::query<molecule *>(const char *token, std::string description)
+{
+  queryMolecule(token, description);
+}
+
+template <> void Dialog::query< std::vector<molecule *> >(const char *token, std::string description)
+{
+  queryMolecules(token, description);
+}
+
+template <> void Dialog::query<Vector>(const char *token, std::string description)
+{
+  queryVector(token, false, description);
+}
+
+template <> void Dialog::query< std::vector<Vector> >(const char *token, std::string description)
+{
+  queryVectors(token, false, description);
+}
+
+template <> void Dialog::query<Box>(const char *token, std::string description)
+{
+  queryBox(token, description);
+}
+
+template <> void Dialog::query<const element *>(const char *token, std::string description)
+{
+  queryElement(token, description);
+}
+
+template <> void Dialog::query< std::vector<const element *> >(const char *token, std::string description)
+{
+  queryElements(token, description);
+}
+
 /****************** Query types Infrastructure **************************/
 
Index: src/UIElements/Dialog.hpp
===================================================================
--- src/UIElements/Dialog.hpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/UIElements/Dialog.hpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -37,4 +37,6 @@
   Dialog();
   virtual ~Dialog();
+
+  template <class T> void query(const char *, std::string = "");
 
   virtual void queryEmpty(const char *, std::string = "")=0;
Index: src/UIElements/QT4/QTDialog.cpp
===================================================================
--- src/UIElements/QT4/QTDialog.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/UIElements/QT4/QTDialog.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -98,25 +98,25 @@
 /************************** Query Infrastructure ************************/
 
-void QTDialog::queryEmpty(char const*, string){
+void QTDialog::queryEmpty(const char*, std::string){
   // TODO
   ASSERT(false, "Not implemented yet");
 }
 
-void QTDialog::queryBoolean(char const*,string){
+void QTDialog::queryBoolean(const char*,string){
   // TODO
   ASSERT(false, "Not implemented yet");
 }
 
-void QTDialog::queryAtom(char const*, string){
+void QTDialog::queryAtom(const char*, std::string){
   // TODO
   ASSERT(false, "Not implemented yet");
 }
 
-void QTDialog::queryAtoms(char const*, string){
+void QTDialog::queryAtoms(const char*, std::string){
   // TODO
   ASSERT(false, "Not implemented yet");
 }
 
-void QTDialog::queryBox(char const*, string){
+void QTDialog::queryBox(const char*, std::string){
   // TODO
   ASSERT(false, "Not implemented yet");
@@ -172,9 +172,9 @@
 }
 
-void QTDialog::queryElement(const char* title, string){
+void QTDialog::queryElement(const char* title, std::string){
   registerQuery(new ElementQTQuery(title,inputLayout,this));
 }
 
-void QTDialog::queryElements(const char* title, string){
+void QTDialog::queryElements(const char* title, std::string){
   // TODO
   ASSERT(false, "Not implemented yet");
@@ -353,5 +353,5 @@
 }
 
-// All values besides the empty string are valid
+// All values besides the empty std::string are valid
 bool QTDialog::StringQTQuery::handle()
 {
@@ -400,9 +400,9 @@
 }
 
-// All values besides the empty string are valid
+// All values besides the empty std::string are valid
 bool QTDialog::StringsQTQuery::handle()
 {
   // dissect by ","
-  string::iterator olditer = temp.begin();
+  std::string::iterator olditer = temp.begin();
   for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
     if (*iter == ' ') {
@@ -429,5 +429,5 @@
       iter != molecules.end();
       ++iter) {
-    stringstream sstr;
+    std::stringstream sstr;
     sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
     inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
@@ -465,5 +465,5 @@
       iter != molecules.end();
       ++iter) {
-    stringstream sstr;
+    std::stringstream sstr;
     sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
     inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
@@ -565,5 +565,5 @@
       ++iter)
   {
-    stringstream sstr;
+    std::stringstream sstr;
     sstr << (*iter).first << "\t" << (*iter).second->getName();
     inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
@@ -600,5 +600,5 @@
       ++iter)
   {
-    stringstream sstr;
+    std::stringstream sstr;
     sstr << (*iter).first << "\t" << (*iter).second->getName();
     inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
Index: src/UIElements/TextUI/TextDialog.cpp
===================================================================
--- src/UIElements/TextUI/TextDialog.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/UIElements/TextUI/TextDialog.cpp	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -57,70 +57,69 @@
 }
 
-
-void TextDialog::queryEmpty(const char* title, string description){
+void TextDialog::queryEmpty(const char* title, std::string description){
   registerQuery(new EmptyTextQuery(title,description));
 }
 
-void TextDialog::queryBoolean(const char* title, string description){
+void TextDialog::queryBoolean(const char* title, std::string description){
   registerQuery(new BooleanTextQuery(title,description));
 }
 
-void TextDialog::queryInt(const char* title, string description){
+void TextDialog::queryInt(const char* title, std::string description){
   registerQuery(new IntTextQuery(title,description));
 }
 
-void TextDialog::queryInts(const char* title, string description){
+void TextDialog::queryInts(const char* title, std::string description){
   registerQuery(new IntsTextQuery(title,description));
 }
 
-void TextDialog::queryDouble(const char* title, string description){
+void TextDialog::queryDouble(const char* title, std::string description){
   registerQuery(new DoubleTextQuery(title,description));
 }
 
-void TextDialog::queryDoubles(const char* title, string description){
+void TextDialog::queryDoubles(const char* title, std::string description){
   registerQuery(new DoublesTextQuery(title,description));
 }
 
-void TextDialog::queryString(const char* title, string description){
+void TextDialog::queryString(const char* title, std::string description){
   registerQuery(new StringTextQuery(title,description));
 }
 
-void TextDialog::queryStrings(const char* title, string description){
+void TextDialog::queryStrings(const char* title, std::string description){
   registerQuery(new StringsTextQuery(title,description));
 }
 
-void TextDialog::queryAtom(const char* title, string description) {
+void TextDialog::queryAtom(const char* title, std::string description) {
   registerQuery(new AtomTextQuery(title,description));
 }
 
-void TextDialog::queryAtoms(const char* title, string description) {
+void TextDialog::queryAtoms(const char* title, std::string description) {
   registerQuery(new AtomsTextQuery(title,description));
 }
 
-void TextDialog::queryMolecule(const char* title, string description) {
+void TextDialog::queryMolecule(const char* title, std::string description) {
   registerQuery(new MoleculeTextQuery(title,description));
 }
 
-void TextDialog::queryMolecules(const char* title, string description) {
+void TextDialog::queryMolecules(const char* title, std::string description) {
   registerQuery(new MoleculesTextQuery(title,description));
 }
 
-void TextDialog::queryVector(const char* title, bool check, string description) {
+void TextDialog::queryVector(const char* title, bool check, std::string description) {
   registerQuery(new VectorTextQuery(title,check,description));
 }
 
-void TextDialog::queryVectors(const char* title, bool check, string description) {
+void TextDialog::queryVectors(const char* title, bool check, std::string description) {
   registerQuery(new VectorsTextQuery(title,check,description));
 }
 
-void TextDialog::queryBox(const char* title, string description) {
+void TextDialog::queryBox(const char* title, std::string description) {
   registerQuery(new BoxTextQuery(title,description));
 }
 
-void TextDialog::queryElement(const char* title, string description){
+void TextDialog::queryElement(const char* title, std::string description){
   registerQuery(new ElementTextQuery(title,description));
 }
 
-void TextDialog::queryElements(const char* title, string description){
+void TextDialog::queryElements(const char* title, std::string description){
   registerQuery(new ElementsTextQuery(title,description));
 }
@@ -174,5 +173,5 @@
   getline(cin,line);
   // dissect by " "
-  string::iterator olditer = line.begin();
+  std::string::iterator olditer = line.begin();
   for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
     if (*iter == ' ') {
@@ -243,5 +242,5 @@
   getline(cin,temp);
   // dissect by " "
-  string::iterator olditer = temp.begin();
+  std::string::iterator olditer = temp.begin();
   for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
     if (*iter == ' ') {
@@ -291,5 +290,5 @@
   getline(cin,line);
   // dissect by " "
-  string::iterator olditer = line.begin();
+  std::string::iterator olditer = line.begin();
   for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
     if (*iter == ' ') {
@@ -354,5 +353,5 @@
   getline(cin,line);
   // dissect by " "
-  string::iterator olditer = line.begin();
+  std::string::iterator olditer = line.begin();
   for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
     if (*iter == ' ') {
@@ -426,5 +425,5 @@
   getline(cin,line);
   // dissect by " "
-  string::iterator olditer = line.begin();
+  std::string::iterator olditer = line.begin();
   for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
     if (*iter == ' ') {
@@ -473,5 +472,5 @@
   double coord = 0.;
   int counter = 0;
-  string::iterator olditer = line.begin();
+  std::string::iterator olditer = line.begin();
   for(string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) {
     if (*iter == ',') {
@@ -511,6 +510,6 @@
   // dissect by ","
   double coord = 0.;
-  string::iterator olditerspace = line.begin();
-  string::iterator olditercomma = line.begin();
+  std::string::iterator olditerspace = line.begin();
+  std::string::iterator olditercomma = line.begin();
   int counter = 0;
   for(string::iterator vectoriter = line.begin(); vectoriter != line.end(); ++vectoriter) {
@@ -608,6 +607,6 @@
     // Try to read as shorthand
     // the last buffer content was not removed, so we read the
-    // same thing again, this time as a string
-    string shorthand;
+    // same thing again, this time as a std::string
+    std::string shorthand;
     cin >> shorthand;
     if(!cin.fail()){
@@ -649,5 +648,5 @@
   getline(cin,line);
   // dissect by " "
-  string::iterator olditer = line.begin();
+  std::string::iterator olditer = line.begin();
   for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
     if (*iter == ' ') {
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/unittests/Makefile.am	(revision 9ee38b1c3b23a38c779c8e4ad098fe0677a3a5b7)
@@ -57,4 +57,5 @@
 	${BOOST_THREAD_LIB}
 ALLLIBS = \
+	../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
 	../Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
 	${PARSERLIBS} \
