Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs	(revision 5510)
@@ -45,6 +45,6 @@
 
     #region parameter properties
-    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
-      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     }
     public ScopeTreeLookupParameter<DoubleValue> SymbolicExpressionTreeLengthParameter {
@@ -73,5 +73,5 @@
     public MinAverageMaxSymbolicExpressionTreeLengthAnalyzer()
       : base() {
-      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated."));
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated."));
       Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(SymbolicExpressionTreeLengthParameterName, "The length of the symbolic expression tree."));
       Parameters.Add(new ValueLookupParameter<DataTable>(SymbolicExpressionTreeLengthsParameterName, "The data table to store the symbolic expression tree lengths."));
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs	(revision 5510)
@@ -42,6 +42,6 @@
 
     #region parameter properties
-    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
-      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     }
     public ILookupParameter<DataTable> SymbolFrequenciesParameter {
@@ -64,5 +64,5 @@
     public SymbolicExpressionSymbolFrequencyAnalyzer()
       : base() {
-      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
       Parameters.Add(new ValueLookupParameter<DataTable>(SymbolFrequenciesParameterName, "The data table to store the symbol frequencies."));
       Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the symbol frequencies should be stored."));
@@ -73,5 +73,5 @@
 
     public override IOperation Apply() {
-      ItemArray<SymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue;
+      ItemArray<ISymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue;
       ResultCollection results = ResultsParameter.ActualValue;
 
@@ -102,5 +102,5 @@
     }
 
-    public static IEnumerable<KeyValuePair<string, double>> CalculateSymbolFrequencies(IEnumerable<SymbolicExpressionTree> trees) {
+    public static IEnumerable<KeyValuePair<string, double>> CalculateSymbolFrequencies(IEnumerable<ISymbolicExpressionTree> trees) {
       Dictionary<string, double> symbolFrequencies = new Dictionary<string, double>();
       int totalNumberOfSymbols = 0;
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs	(revision 5510)
@@ -27,4 +27,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Parameters;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
@@ -33,19 +34,39 @@
   /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 106
   /// </summary>
-  [Item("ArgumentCreater", "Manipulates a symbolic expression by creating a new argument within one function-defining branch.")]
+  [Item("ArgumentCreater", "Manipulates a symbolic expression by creating a new argument within one function-defining branch. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 106")]
   [StorableClass]
-  public sealed class ArgumentCreater : SymbolicExpressionTreeArchitectureManipulator {
+  public sealed class ArgumentCreater : SymbolicExpressionTreeArchitectureManipulator, ISymbolicExpressionTreeSizeConstraintOperator {
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
     [StorableConstructor]
     private ArgumentCreater(bool deserializing) : base(deserializing) { }
     private ArgumentCreater(ArgumentCreater original, Cloner cloner) : base(original, cloner) { }
-    public ArgumentCreater() : base() { }
+    public ArgumentCreater()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+    }
+
     public override sealed void ModifyArchitecture(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      IntValue maxTreeSize, IntValue maxTreeHeight,
-      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
-      out bool success) {
-      success = CreateNewArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      CreateNewArgument(random, symbolicExpressionTree, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
     }
 
@@ -56,11 +77,10 @@
     public static bool CreateNewArgument(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      int maxTreeSize, int maxTreeHeight,
-      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxTreeLength, int maxTreeDepth,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
       // work on a copy in case we find out later that the tree would be too big
       // in this case it's easiest to simply return the original tree.
-      SymbolicExpressionTree clonedTree = (SymbolicExpressionTree)symbolicExpressionTree.Clone();
+      ISymbolicExpressionTree clonedTree = (ISymbolicExpressionTree)symbolicExpressionTree.Clone();
 
       var functionDefiningBranches = clonedTree.IterateNodesPrefix().OfType<DefunTreeNode>();
@@ -83,5 +103,5 @@
       // this operation potentially creates very big trees so the access to the size property might throw overflow exception
       try {
-        if (CreateNewArgumentForDefun(random, clonedTree, selectedDefunBranch, newArgumentNode) && clonedTree.Size <= maxTreeSize && clonedTree.Height <= maxTreeHeight) {
+        if (CreateNewArgumentForDefun(random, clonedTree, selectedDefunBranch, newArgumentNode) && clonedTree.Size <= maxTreeLength && clonedTree.Height <= maxTreeDepth) {
 
           // size constraints are fulfilled 
@@ -100,11 +120,11 @@
     }
 
-    private static bool CreateNewArgumentForDefun(IRandom random, SymbolicExpressionTree tree, DefunTreeNode defunBranch, ArgumentTreeNode newArgumentNode) {
+    private static bool CreateNewArgumentForDefun(IRandom random, ISymbolicExpressionTree tree, DefunTreeNode defunBranch, ArgumentTreeNode newArgumentNode) {
       // select a random cut point in the function defining branch
       // the branch at the cut point is to be replaced by a new argument node
       var cutPoints = (from node in defunBranch.IterateNodesPrefix()
-                       where node.SubTrees.Count > 0
+                       where node.SubTrees.Count() > 0
                        from subtree in node.SubTrees
-                       select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).ToList();
+                       select new { Parent = node, ReplacedChildIndex = node.IndexOfSubTree(subtree), ReplacedChild = subtree }).ToList();
 
       if (cutPoints.Count() == 0)
@@ -121,14 +141,14 @@
       var invocationNodes = (from node in tree.IterateNodesPostfix().OfType<InvokeFunctionTreeNode>()
                              where node.Symbol.FunctionName == defunBranch.FunctionName
-                             where node.SubTrees.Count == defunBranch.NumberOfArguments
+                             where node.SubTrees.Count() == defunBranch.NumberOfArguments
                              select node).ToList();
       // do this repeatedly until no matching invocations are found      
       while (invocationNodes.Count > 0) {
-        List<SymbolicExpressionTreeNode> newlyAddedBranches = new List<SymbolicExpressionTreeNode>();
+        List<ISymbolicExpressionTreeNode> newlyAddedBranches = new List<ISymbolicExpressionTreeNode>();
         foreach (var invocationNode in invocationNodes) {
           // check that the invocation node really has the correct number of arguments
-          if (invocationNode.SubTrees.Count != defunBranch.NumberOfArguments) throw new InvalidOperationException();
+          if (invocationNode.SubTrees.Count() != defunBranch.NumberOfArguments) throw new InvalidOperationException();
           // append a new argument branch after expanding all argument nodes
-          var clonedBranch = (SymbolicExpressionTreeNode)replacedBranch.Clone();
+          var clonedBranch = (ISymbolicExpressionTreeNode)replacedBranch.Clone();
           clonedBranch = ReplaceArgumentsInBranch(clonedBranch, invocationNode.SubTrees);
           invocationNode.InsertSubTree(newArgumentNode.Symbol.ArgumentIndex, clonedBranch);
@@ -139,5 +159,5 @@
                            from node in newlyAddedBranch.IterateNodesPostfix().OfType<InvokeFunctionTreeNode>()
                            where node.Symbol.FunctionName == defunBranch.FunctionName
-                           where node.SubTrees.Count == defunBranch.NumberOfArguments
+                           where node.SubTrees.Count() == defunBranch.NumberOfArguments
                            select node).ToList();
       }
@@ -171,13 +191,13 @@
     }
 
-    private static SymbolicExpressionTreeNode ReplaceArgumentsInBranch(SymbolicExpressionTreeNode branch, IList<SymbolicExpressionTreeNode> argumentTrees) {
+    private static ISymbolicExpressionTreeNode ReplaceArgumentsInBranch(ISymbolicExpressionTreeNode branch, IEnumerable<ISymbolicExpressionTreeNode> argumentTrees) {
       ArgumentTreeNode argNode = branch as ArgumentTreeNode;
       if (argNode != null) {
         // replace argument nodes by a clone of the original subtree that provided the result for the argument node
-        return (SymbolicExpressionTreeNode)argumentTrees[argNode.Symbol.ArgumentIndex].Clone();
+        return (SymbolicExpressionTreeNode)argumentTrees.ElementAt(argNode.Symbol.ArgumentIndex).Clone();
       } else {
         // call recursively for all subtree
-        List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(branch.SubTrees);
-        while (branch.SubTrees.Count > 0) branch.RemoveSubTree(0);
+        List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(branch.SubTrees);
+        while (branch.SubTrees.Count() > 0) branch.RemoveSubTree(0);
         foreach (var subtree in subtrees) {
           branch.AddSubTree(ReplaceArgumentsInBranch(subtree, argumentTrees));
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDeleter.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDeleter.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDeleter.cs	(revision 5510)
@@ -30,5 +30,5 @@
   /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 112
   /// </summary>
-  [Item("ArgumentDeleter", "Manipulates a symbolic expression by deleting an argument from an existing function defining branch.")]
+  [Item("ArgumentDeleter", "Manipulates a symbolic expression by deleting an argument from an existing function defining branch. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 112")]
   [StorableClass]
   public sealed class ArgumentDeleter : SymbolicExpressionTreeArchitectureManipulator {
@@ -40,10 +40,7 @@
     public override sealed void ModifyArchitecture(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      IntValue maxTreeSize, IntValue maxTreeHeight,
-      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
-      out bool success) {
-      success = DeleteArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DeleteArgument(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
     }
 
@@ -54,8 +51,6 @@
     public static bool DeleteArgument(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      int maxTreeSize, int maxTreeHeight,
-      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
 
       var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 5510)
@@ -33,5 +33,5 @@
   /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 94
   /// </summary>
-  [Item("ArgumentDuplicater", "Manipulates a symbolic expression by duplicating an existing argument node of a function-defining branch.")]
+  [Item("ArgumentDuplicater", "Manipulates a symbolic expression by duplicating an existing argument node of a function-defining branch. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 94")]
   [StorableClass]
   public sealed class ArgumentDuplicater : SymbolicExpressionTreeArchitectureManipulator {
@@ -43,10 +43,7 @@
     public override sealed void ModifyArchitecture(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      IntValue maxTreeSize, IntValue maxTreeHeight,
-      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
-      out bool success) {
-      success = DuplicateArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DuplicateArgument(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
     }
 
@@ -57,8 +54,6 @@
     public static bool DuplicateArgument(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      int maxTreeSize, int maxTreeHeight,
-      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
       var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
 
@@ -91,14 +86,14 @@
       var invocationNodes = (from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
                              where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
-                             where node.SubTrees.Count == selectedDefunBranch.NumberOfArguments
+                             where node.SubTrees.Count() == selectedDefunBranch.NumberOfArguments
                              select node).ToList();
       // do this repeatedly until no matching invocations are found      
       while (invocationNodes.Count() > 0) {
-        List<SymbolicExpressionTreeNode> newlyAddedBranches = new List<SymbolicExpressionTreeNode>();
+        List<ISymbolicExpressionTreeNode> newlyAddedBranches = new List<ISymbolicExpressionTreeNode>();
         foreach (var invokeNode in invocationNodes) {
           // check that the invocation node really has the correct number of arguments
-          if (invokeNode.SubTrees.Count != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException();
-          var argumentBranch = invokeNode.SubTrees[selectedArgumentSymbol.ArgumentIndex];
-          var clonedArgumentBranch = (SymbolicExpressionTreeNode)argumentBranch.Clone();
+          if (invokeNode.SubTrees.Count() != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException();
+          var argumentBranch = invokeNode.GetSubTree(selectedArgumentSymbol.ArgumentIndex);
+          var clonedArgumentBranch = (ISymbolicExpressionTreeNode)argumentBranch.Clone();
           invokeNode.InsertSubTree(newArgumentIndex, clonedArgumentBranch);
           newlyAddedBranches.Add(clonedArgumentBranch);
@@ -107,5 +102,5 @@
                            from node in newlyAddedBranch.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
                            where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
-                           where node.SubTrees.Count == selectedDefunBranch.NumberOfArguments
+                           where node.SubTrees.Count() == selectedDefunBranch.NumberOfArguments
                            select node).ToList();
       }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 5510)
@@ -35,11 +35,13 @@
   [Item("MultiSymbolicExpressionTreeArchitectureManipulator", "Randomly selects and applies one of its architecture manipulators every time it is called.")]
   [StorableClass]
-  public sealed class MultiSymbolicExpressionTreeArchitectureManipulator : StochasticMultiBranch<ISymbolicExpressionTreeArchitectureManipulator>, ISymbolicExpressionTreeArchitectureManipulator, IStochasticOperator {
-    private const string MaxTreeSizeParameterName = "MaxTreeSize";
-    private const string MaxTreeHeightParameterName = "MaxTreeHeight";
-    private const string SymbolicExpressionGrammarParameterName = "SymbolicExpressionGrammar";
+  public sealed class MultiSymbolicExpressionTreeArchitectureManipulator : StochasticMultiBranch<ISymbolicExpressionTreeArchitectureManipulator>, 
+    ISymbolicExpressionTreeArchitectureManipulator, 
+    ISymbolicExpressionTreeSizeConstraintOperator,
+    IStochasticOperator {
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
     private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
-    private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments";
-    private const string MaxFunctionDefiningBranchesParameterName = "MaxFunctionDefiningBranches";
+    private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
+    private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
 
     public override bool CanChangeName {
@@ -49,28 +51,33 @@
       get { return true; }
     }
-    #region ISymbolicExpressionTreeArchitectureManipulator Members
-    public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionDefiningBranchesParameterName]; }
+    #region Parameter properties
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     }
-    public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }
+    public IValueLookupParameter<IntValue> MaximumFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
     }
     #endregion
-
-    #region ISymbolicExpressionTreeManipulator Members
-    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
-      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    #region Parameter Properties
+    public IntValue MaximumFunctionDefinitions {
+      get { return MaximumFunctionDefinitionsParameter.ActualValue; }
     }
-    #endregion
-
-    #region ISymbolicExpressionTreeOperator Members
-    public IValueLookupParameter<IntValue> MaxTreeSizeParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeSizeParameterName]; }
+    public IntValue MaximumFunctionArguments {
+      get { return MaximumFunctionArgumentsParameter.ActualValue; }
     }
-    public IValueLookupParameter<IntValue> MaxTreeHeightParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeHeightParameterName]; }
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
     }
-    public ILookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionGrammarParameter {
-      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionGrammarParameterName]; }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
     }
     #endregion
@@ -82,10 +89,9 @@
     public MultiSymbolicExpressionTreeArchitectureManipulator()
       : base() {
-      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefiningBranchesParameterName, "The maximal allowed number of function defining branches."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionArgumentsParameterName, "The maximal allowed number of arguments of a newly created function."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeSizeParameterName, "The maximal size (number of nodes) of the symbolic expression tree."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeHeightParameterName, "The maximal height of the symbolic expression tree (a tree with one node has height = 0)."));
-      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionGrammarParameterName, "The grammar that defines the allowed symbols and syntax of the symbolic expression trees."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumFunctionDefinitionsParameterName, "The maximal allowed number of automatically defined functions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumFunctionArgumentsParameterName, "The maximal allowed number of arguments of a automatically defined functions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
 
       foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeArchitectureManipulator))) {
@@ -111,23 +117,18 @@
     private void ParameterizeManipulators() {
       foreach (ISymbolicExpressionTreeArchitectureManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeArchitectureManipulator>()) {
-        manipulator.MaxTreeSizeParameter.ActualName = MaxTreeSizeParameter.Name;
-        manipulator.MaxTreeHeightParameter.ActualName = MaxTreeHeightParameter.Name;
-        manipulator.SymbolicExpressionGrammarParameter.ActualName = SymbolicExpressionGrammarParameter.Name;
+        manipulator.MaximumFunctionArgumentsParameter.ActualName = MaximumFunctionArgumentsParameter.Name;
+        manipulator.MaximumFunctionDefinitionsParameter.ActualName = MaximumFunctionDefinitionsParameter.Name;
+      }
+      foreach(ISymbolicExpressionTreeSizeConstraintOperator manipulator in Operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
+        manipulator.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name;
+        manipulator.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
+      }
+      foreach(ISymbolicExpressionTreeManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeManipulator>()) {
         manipulator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
-        manipulator.MaxFunctionDefinitionsParameter.ActualName = MaxFunctionDefinitionsParameter.Name;
-        manipulator.MaxFunctionArgumentsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
       }
-
       foreach (IStochasticOperator manipulator in Operators.OfType<IStochasticOperator>()) {
         manipulator.RandomParameter.ActualName = RandomParameter.Name;
       }
     }
-
-    #region ISymbolicExpressionTreeArchitectureManipulator Members
-    public void ModifyArchitecture(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments, out bool success) {
-      var op = Operators.SelectRandom(random);
-      op.ModifyArchitecture(random, symbolicExpressionTree, grammar, maxTreeSize, maxTreeHeight, maxFunctionDefiningBranches, maxFunctionArguments, out success);
-    }
-    #endregion
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs	(revision 5510)
@@ -28,4 +28,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Parameters;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
@@ -35,13 +36,33 @@
   /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 97
   /// </summary>
-  [Item("SubroutineCreater", "Manipulates a symbolic expression by adding one new function-defining branch containing a proportion of a preexisting branch and by creating a reference to the new branch.")]
+  [Item("SubroutineCreater", "Manipulates a symbolic expression by adding one new function-defining branch containing a proportion of a preexisting branch and by creating a reference to the new branch. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 97")]
   [StorableClass]
-  public sealed class SubroutineCreater : SymbolicExpressionTreeArchitectureManipulator {
+  public sealed class SubroutineCreater : SymbolicExpressionTreeArchitectureManipulator, ISymbolicExpressionTreeSizeConstraintOperator {
     private const double ARGUMENT_CUTOFF_PROBABILITY = 0.05;
-
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
     [StorableConstructor]
     private SubroutineCreater(bool deserializing) : base(deserializing) { }
     private SubroutineCreater(SubroutineCreater original, Cloner cloner) : base(original, cloner) { }
-    public SubroutineCreater() : base() { }
+    public SubroutineCreater() : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+    }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -51,27 +72,23 @@
     public override sealed void ModifyArchitecture(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      IntValue maxTreeSize, IntValue maxTreeHeight,
-      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
-      out bool success) {
-      success = CreateSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      CreateSubroutine(random, symbolicExpressionTree, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
     }
 
     public static bool CreateSubroutine(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      int maxTreeSize, int maxTreeHeight,
-      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxTreeLength, int maxTreeDepth,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
       var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
-      if (functionDefiningBranches.Count() >= maxFunctionDefiningBranches)
+      if (functionDefiningBranches.Count() >= maxFunctionDefinitions)
         // allowed maximum number of ADF reached => abort
         return false;
-      if (symbolicExpressionTree.Size + 4 > maxTreeSize)
+      if (symbolicExpressionTree.Size + 4 > maxTreeLength)
         // defining a new function causes an size increase by 4 nodes (max) if the max tree size is reached => abort
         return false;
-      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefiningBranches * 10 - 1)).ToString(); // >= 100 functions => ###
-      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefiningBranches)
+      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefinitions * 10 - 1)).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefinitions)
                                  select "ADF" + index.ToString(formatString);
 
@@ -82,5 +99,5 @@
       int r = random.Next(totalNumberOfBodyNodes);
       int aggregatedNumberOfBodyNodes = 0;
-      SymbolicExpressionTreeNode selectedBody = null;
+      ISymbolicExpressionTreeNode selectedBody = null;
       foreach (var body in bodies) {
         aggregatedNumberOfBodyNodes += body.Size;
@@ -94,5 +111,5 @@
       var allCutPoints = from parent in selectedBody.IterateNodesPrefix()
                          from subtree in parent.SubTrees
-                         select new { Parent = parent, ReplacedBranchIndex = parent.SubTrees.IndexOf(subtree), ReplacedBranch = subtree };
+                         select new { Parent = parent, ReplacedBranchIndex = parent.IndexOfSubTree(subtree), ReplacedBranch = subtree };
       if (allCutPoints.Count() == 0)
         // no cut points => abort
@@ -101,6 +118,6 @@
       var selectedCutPoint = allCutPoints.SelectRandom(random);
       // select random branches as argument cut-off points (replaced by argument terminal nodes in the function)
-      List<SymbolicExpressionTreeNode> argumentBranches = SelectRandomArgumentBranches(selectedCutPoint.ReplacedBranch, random, ARGUMENT_CUTOFF_PROBABILITY, maxFunctionArguments);
-      SymbolicExpressionTreeNode functionBody = selectedCutPoint.ReplacedBranch;
+      List<ISymbolicExpressionTreeNode> argumentBranches = SelectRandomArgumentBranches(selectedCutPoint.ReplacedBranch, random, ARGUMENT_CUTOFF_PROBABILITY, maxFunctionArguments);
+      ISymbolicExpressionTreeNode functionBody = selectedCutPoint.ReplacedBranch;
       // disconnect the function body from the tree
       selectedCutPoint.Parent.RemoveSubTree(selectedCutPoint.ReplacedBranchIndex);
@@ -120,5 +137,5 @@
       symbolicExpressionTree.Root.AddSubTree(defunNode);
       // the grammar in the newly defined function is a clone of the grammar of the originating branch
-      defunNode.SetGrammar((ISymbolicExpressionGrammar)selectedBody.Grammar.Clone());
+      defunNode.SetGrammar((ISymbolicExpressionTreeGrammar)selectedBody.Grammar.Clone());
       // remove all argument symbols from grammar
       var oldArgumentSymbols = defunNode.Grammar.Symbols.OfType<Argument>().ToList();
@@ -164,5 +181,5 @@
     }
 
-    private static SymbolicExpressionTreeNode DisconnectBranches(SymbolicExpressionTreeNode node, List<SymbolicExpressionTreeNode> argumentBranches) {
+    private static ISymbolicExpressionTreeNode DisconnectBranches(ISymbolicExpressionTreeNode node, List<ISymbolicExpressionTreeNode> argumentBranches) {
       if (argumentBranches.Contains(node)) {
         var argumentIndex = argumentBranches.IndexOf(node);
@@ -171,6 +188,6 @@
       }
       // remove the subtrees so that we can clone only the root node
-      List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(node.SubTrees);
-      while (node.SubTrees.Count > 0) node.RemoveSubTree(0);
+      List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(node.SubTrees);
+      while (node.SubTrees.Count() > 0) node.RemoveSubTree(0);
       // recursively apply function for subtrees or append a argument terminal node
       foreach (var subtree in subtrees) {
@@ -180,5 +197,5 @@
     }
 
-    private static List<SymbolicExpressionTreeNode> SelectRandomArgumentBranches(SymbolicExpressionTreeNode selectedRoot,
+    private static List<ISymbolicExpressionTreeNode> SelectRandomArgumentBranches(ISymbolicExpressionTreeNode selectedRoot,
       IRandom random,
       double cutProbability,
@@ -186,5 +203,5 @@
       // breadth first determination of argument cut-off points
       // we must make sure that we cut off all original argument nodes and that the number of new argument is smaller than the limit
-      List<SymbolicExpressionTreeNode> argumentBranches = new List<SymbolicExpressionTreeNode>();
+      List<ISymbolicExpressionTreeNode> argumentBranches = new List<ISymbolicExpressionTreeNode>();
       if (selectedRoot is ArgumentTreeNode) {
         argumentBranches.Add(selectedRoot);
@@ -202,8 +219,8 @@
         }
         // cut-off in the sub-trees in random order
-        var randomIndexes = (from index in Enumerable.Range(0, selectedRoot.SubTrees.Count)
+        var randomIndexes = (from index in Enumerable.Range(0, selectedRoot.SubTrees.Count())
                              select new { Index = index, OrderValue = random.NextDouble() }).OrderBy(x => x.OrderValue).Select(x => x.Index);
         foreach (var subtreeIndex in randomIndexes) {
-          var subtree = selectedRoot.SubTrees[subtreeIndex];
+          var subtree = selectedRoot.GetSubTree(subtreeIndex);
           minNewArgumentsForSubtrees[subtreeIndex] = 0;
           // => cut-off at 0..n points somewhere in the current sub-tree
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDeleter.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDeleter.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDeleter.cs	(revision 5510)
@@ -33,5 +33,5 @@
   /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 108
   /// </summary>
-  [Item("SubroutineDeleter", "Manipulates a symbolic expression by deleting a preexisting function-defining branch.")]
+  [Item("SubroutineDeleter", "Manipulates a symbolic expression by deleting a preexisting function-defining branch. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 108")]
   [StorableClass]
   public sealed class SubroutineDeleter : SymbolicExpressionTreeArchitectureManipulator {
@@ -47,18 +47,13 @@
     public override sealed void ModifyArchitecture(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      IntValue maxTreeSize, IntValue maxTreeHeight,
-      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
-      out bool success) {
-      success = DeleteSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DeleteSubroutine(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
     }
 
     public static bool DeleteSubroutine(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      int maxTreeSize, int maxTreeHeight,
-      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
       var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
 
@@ -68,5 +63,5 @@
       var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
       // remove the selected defun
-      int defunSubtreeIndex = symbolicExpressionTree.Root.SubTrees.IndexOf(selectedDefunBranch);
+      int defunSubtreeIndex = symbolicExpressionTree.Root.IndexOfSubTree(selectedDefunBranch);
       symbolicExpressionTree.Root.RemoveSubTree(defunSubtreeIndex);
 
@@ -85,5 +80,5 @@
     }
 
-    private static void DeletionByRandomRegeneration(IRandom random, SymbolicExpressionTree symbolicExpressionTree, DefunTreeNode selectedDefunBranch) {
+    private static void DeletionByRandomRegeneration(IRandom random, ISymbolicExpressionTree symbolicExpressionTree, DefunTreeNode selectedDefunBranch) {
       // find first invocation and replace it with a randomly generated tree
       // can't find all invocations in one step because once we replaced a top level invocation
@@ -92,8 +87,8 @@
                                 from subtree in node.SubTrees.OfType<InvokeFunctionTreeNode>()
                                 where subtree.Symbol.FunctionName == selectedDefunBranch.FunctionName
-                                select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).FirstOrDefault();
+                                select new { Parent = node, ReplacedChildIndex = node.IndexOfSubTree(subtree), ReplacedChild = subtree }).FirstOrDefault();
       while (invocationCutPoint != null) {
         // deletion by random regeneration
-        SymbolicExpressionTreeNode replacementTree = null;
+        ISymbolicExpressionTreeNode replacementTree = null;
         var allowedSymbolsList = invocationCutPoint.Parent.GetAllowedSymbols(invocationCutPoint.ReplacedChildIndex).ToList();
         var weights = allowedSymbolsList.Select(s => s.InitialFrequency);
@@ -115,5 +110,5 @@
                               from subtree in node.SubTrees.OfType<InvokeFunctionTreeNode>()
                               where subtree.Symbol.FunctionName == selectedDefunBranch.FunctionName
-                              select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).FirstOrDefault();
+                              select new { Parent = node, ReplacedChildIndex = node.IndexOfSubTree(subtree), ReplacedChild = subtree }).FirstOrDefault();
       }
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 5510)
@@ -34,5 +34,5 @@
   /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 88
   /// </summary>
-  [Item("SubroutineDuplicater", "Manipulates a symbolic expression by duplicating a preexisting function-defining branch.")]
+  [Item("SubroutineDuplicater", "Manipulates a symbolic expression by duplicating a preexisting function-defining branch. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 88")]
   [StorableClass]
   public sealed class SubroutineDuplicater : SymbolicExpressionTreeArchitectureManipulator {
@@ -50,25 +50,20 @@
     public override sealed void ModifyArchitecture(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      IntValue maxTreeSize, IntValue maxTreeHeight,
-      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
-      out bool success) {
-      success = DuplicateSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DuplicateSubroutine(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
     }
 
     public static bool DuplicateSubroutine(
       IRandom random,
-      SymbolicExpressionTree symbolicExpressionTree,
-      ISymbolicExpressionGrammar grammar,
-      int maxTreeSize, int maxTreeHeight,
-      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
       var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
-      if (functionDefiningBranches.Count() == 0 || functionDefiningBranches.Count() == maxFunctionDefiningBranches)
+      if (functionDefiningBranches.Count() == 0 || functionDefiningBranches.Count() == maxFunctionDefinitions)
         // no function defining branches to duplicate or already reached the max number of ADFs
         return false;
 
-      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefiningBranches) + 1).ToString(); // >= 100 functions => ###
-      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefiningBranches)
+      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefinitions) + 1).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefinitions)
                                  select "ADF" + index.ToString(formatString);
       var selectedBranch = functionDefiningBranches.SelectRandom(random);
@@ -77,5 +72,5 @@
       duplicatedDefunBranch.FunctionName = newFunctionName;
       symbolicExpressionTree.Root.AddSubTree(duplicatedDefunBranch);
-      duplicatedDefunBranch.SetGrammar((ISymbolicExpressionGrammar)selectedBranch.Grammar.Clone());
+      duplicatedDefunBranch.SetGrammar((ISymbolicExpressionTreeGrammar)selectedBranch.Grammar.Clone());
       // add an invoke symbol for each branch that is allowed to invoke the original function
       foreach (var subtree in symbolicExpressionTree.Root.SubTrees.OfType<SymbolicExpressionTreeTopLevelNode>()) {
@@ -104,5 +99,5 @@
     }
 
-    private static IEnumerable<string> UsedFunctionNames(SymbolicExpressionTree symbolicExpressionTree) {
+    private static IEnumerable<string> UsedFunctionNames(ISymbolicExpressionTree symbolicExpressionTree) {
       return from node in symbolicExpressionTree.IterateNodesPrefix()
              where node.Symbol is Defun
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 5510)
@@ -62,5 +62,5 @@
     }
 
-    protected override sealed void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree) {
+    protected override sealed void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
       ModifyArchitecture(random, symbolicExpressionTree, MaximumFunctionDefinitions, MaximumFunctionArguments);
     }
@@ -68,5 +68,5 @@
     public abstract void ModifyArchitecture(
       IRandom random,
-      SymbolicExpressionTree tree,
+      ISymbolicExpressionTree tree,
       IntValue maxFunctionDefinitions,
       IntValue maxFunctionArguments);
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 5510)
@@ -43,5 +43,5 @@
         if (code.Count > ushort.MaxValue) throw new ArgumentException("Code for the tree is too long (> ushort.MaxValue).");
         entryPoint[branch.FunctionName] = (ushort)code.Count;
-        code.AddRange(Compile(branch.SubTrees[0], opCodeMapper));
+        code.AddRange(Compile(branch.GetSubTree(0), opCodeMapper));
       }
       // address of all functions is fixed now
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 5510)
@@ -92,10 +92,10 @@
     }
 
-    protected override SymbolicExpressionTree Create(IRandom random) {
+    protected override ISymbolicExpressionTree Create(IRandom random) {
       return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value,
         MaximumFunctionDefinitions.Value, MaximumFunctionArguments.Value);
     }
 
-    public static SymbolicExpressionTree Create(IRandom random, ISymbolicExpressionTreeGrammar grammar,
+    public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionTreeGrammar grammar,
       int maxTreeSize, int maxTreeHeight,
       int maxFunctionDefinitions, int maxFunctionArguments
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 5510)
@@ -35,11 +35,11 @@
     private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
     #region Parameter Properties
-    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
-      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     }
     #endregion
 
     #region Propeties
-    public SymbolicExpressionTree SymbolicExpressionTree {
+    public ISymbolicExpressionTree SymbolicExpressionTree {
       get { return SymbolicExpressionTreeParameter.ActualValue; }
       set { SymbolicExpressionTreeParameter.ActualValue = value; }
@@ -52,5 +52,5 @@
     protected SymbolicExpressionTreeCreator()
       : base() {
-      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree that should be created."));
     }
 
@@ -60,5 +60,5 @@
     }
 
-    protected abstract SymbolicExpressionTree Create(IRandom random);
+    protected abstract ISymbolicExpressionTree Create(IRandom random);
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/CrossoverPoint.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/CrossoverPoint.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/CrossoverPoint.cs	(revision 5510)
@@ -23,10 +23,10 @@
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
   internal class CrossoverPoint {
-    public SymbolicExpressionTreeNode Parent { get; set; }
-    public SymbolicExpressionTreeNode Child { get; set; }
+    public ISymbolicExpressionTreeNode Parent { get; set; }
+    public ISymbolicExpressionTreeNode Child { get; set; }
     public int SubtreeIndex {
-      get { return Parent.SubTrees.IndexOf(Child); }
+      get { return Parent.IndexOfSubTree(Child); }
     }
-    public CrossoverPoint(SymbolicExpressionTreeNode parent, SymbolicExpressionTreeNode child) {
+    public CrossoverPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {
       this.Parent = parent;
       this.Child = child;
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs	(revision 5510)
@@ -78,23 +78,23 @@
     }
 
-    protected override SymbolicExpressionTree Cross(IRandom random,
-      SymbolicExpressionTree parent0, SymbolicExpressionTree parent1) {
+    protected override ISymbolicExpressionTree Cross(IRandom random,
+      ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
       return Cross(random, parent0, parent1, InternalCrossoverPointProbability.Value,
         MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
     }
 
-    public static SymbolicExpressionTree Cross(IRandom random,
-      SymbolicExpressionTree parent0, SymbolicExpressionTree parent1,
+    public static ISymbolicExpressionTree Cross(IRandom random,
+      ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1,
       double internalCrossoverPointProbability, int maxTreeSize, int maxTreeHeight) {
       // select a random crossover point in the first parent 
-      SymbolicExpressionTreeNode crossoverPoint0;
+      ISymbolicExpressionTreeNode crossoverPoint0;
       int replacedSubtreeIndex;
       SelectCrossoverPoint(random, parent0, internalCrossoverPointProbability, maxTreeSize, maxTreeHeight, out crossoverPoint0, out replacedSubtreeIndex);
 
       // calculate the max size and height that the inserted branch can have 
-      int maxInsertedBranchSize = maxTreeSize - (parent0.Size - crossoverPoint0.SubTrees[replacedSubtreeIndex].GetSize());
+      int maxInsertedBranchSize = maxTreeSize - (parent0.Size - crossoverPoint0.GetSubTree(replacedSubtreeIndex).GetSize());
       int maxInsertedBranchHeight = maxTreeHeight - GetBranchLevel(parent0.Root, crossoverPoint0);
 
-      List<SymbolicExpressionTreeNode> allowedBranches = new List<SymbolicExpressionTreeNode>();
+      List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>();
       parent1.Root.ForEachNodePostfix((n) => {
         if (n.GetSize() <= maxInsertedBranchSize &&
@@ -117,5 +117,5 @@
     }
 
-    private static bool IsMatchingPointType(SymbolicExpressionTreeNode parent, int replacedSubtreeIndex, SymbolicExpressionTreeNode branch) {
+    private static bool IsMatchingPointType(ISymbolicExpressionTreeNode parent, int replacedSubtreeIndex, ISymbolicExpressionTreeNode branch) {
       // check syntax constraints of direct parent - child relation
       if (!parent.Grammar.ContainsSymbol(branch.Symbol) ||
@@ -128,20 +128,20 @@
           result &&
           parent.Grammar.ContainsSymbol(n.Symbol) &&
-          n.SubTrees.Count >= parent.Grammar.GetMinSubtreeCount(n.Symbol) &&
-          n.SubTrees.Count <= parent.Grammar.GetMaxSubtreeCount(n.Symbol);
+          n.SubTrees.Count() >= parent.Grammar.GetMinSubtreeCount(n.Symbol) &&
+          n.SubTrees.Count() <= parent.Grammar.GetMaxSubtreeCount(n.Symbol);
       });
       return result;
     }
 
-    private static void SelectCrossoverPoint(IRandom random, SymbolicExpressionTree parent0, double internalNodeProbability, int maxBranchSize, int maxBranchHeight, out SymbolicExpressionTreeNode crossoverPoint, out int subtreeIndex) {
+    private static void SelectCrossoverPoint(IRandom random, ISymbolicExpressionTree parent0, double internalNodeProbability, int maxBranchSize, int maxBranchHeight, out ISymbolicExpressionTreeNode crossoverPoint, out int subtreeIndex) {
       if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
       List<CrossoverPoint> internalCrossoverPoints = new List<CrossoverPoint>();
       List<CrossoverPoint> leafCrossoverPoints = new List<CrossoverPoint>();
       parent0.Root.ForEachNodePostfix((n) => {
-        if (n.SubTrees.Count > 0 && n != parent0.Root) {
+        if (n.SubTrees.Count() > 0 && n != parent0.Root) {
           foreach (var child in n.SubTrees) {
             if (child.GetSize() <= maxBranchSize &&
                 child.GetHeight() <= maxBranchHeight) {
-              if (child.SubTrees.Count > 0)
+              if (child.SubTrees.Count() > 0)
                 internalCrossoverPoints.Add(new CrossoverPoint(n, child));
               else
@@ -178,12 +178,12 @@
     }
 
-    private static SymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<SymbolicExpressionTreeNode> branches, double internalNodeProbability) {
+    private static ISymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<ISymbolicExpressionTreeNode> branches, double internalNodeProbability) {
       if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
-      List<SymbolicExpressionTreeNode> allowedInternalBranches;
-      List<SymbolicExpressionTreeNode> allowedLeafBranches;
+      List<ISymbolicExpressionTreeNode> allowedInternalBranches;
+      List<ISymbolicExpressionTreeNode> allowedLeafBranches;
       if (random.NextDouble() < internalNodeProbability) {
         // select internal node if possible
         allowedInternalBranches = (from branch in branches
-                                   where branch.SubTrees.Count > 0
+                                   where branch.SubTrees.Count() > 0
                                    select branch).ToList();
         if (allowedInternalBranches.Count > 0) {
@@ -192,5 +192,5 @@
           // no internal nodes allowed => select leaf nodes
           allowedLeafBranches = (from branch in branches
-                                 where branch.SubTrees.Count == 0
+                                 where branch.SubTrees.Count() == 0
                                  select branch).ToList();
           return allowedLeafBranches.SelectRandom(random);
@@ -199,5 +199,5 @@
         // select leaf node if possible
         allowedLeafBranches = (from branch in branches
-                               where branch.SubTrees.Count == 0
+                               where branch.SubTrees.Count() == 0
                                select branch).ToList();
         if (allowedLeafBranches.Count > 0) {
@@ -205,5 +205,5 @@
         } else {
           allowedInternalBranches = (from branch in branches
-                                     where branch.SubTrees.Count > 0
+                                     where branch.SubTrees.Count() > 0
                                      select branch).ToList();
           return allowedInternalBranches.SelectRandom(random);
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs	(revision 5510)
@@ -37,16 +37,16 @@
     private const string ChildParameterName = "Child";
     #region Parameter Properties
-    public ILookupParameter<ItemArray<SymbolicExpressionTree>> ParentsParameter {
-      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[ParentsParameterName]; }
+    public ILookupParameter<ItemArray<ISymbolicExpressionTree>> ParentsParameter {
+      get { return (ScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[ParentsParameterName]; }
     }
-    public ILookupParameter<SymbolicExpressionTree> ChildParameter {
-      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[ChildParameterName]; }
+    public ILookupParameter<ISymbolicExpressionTree> ChildParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[ChildParameterName]; }
     }
     #endregion
     #region Properties
-    public ItemArray<SymbolicExpressionTree> Parents {
+    public ItemArray<ISymbolicExpressionTree> Parents {
       get { return ParentsParameter.ActualValue; }
     }
-    public SymbolicExpressionTree Child {
+    public ISymbolicExpressionTree Child {
       get { return ChildParameter.ActualValue; }
       set { ChildParameter.ActualValue = value; }
@@ -58,6 +58,6 @@
     protected SymbolicExpressionTreeCrossover()
       : base() {
-      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));
-      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(ChildParameterName, "The child symbolic expression tree resulting from the crossover."));
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(ChildParameterName, "The child symbolic expression tree resulting from the crossover."));
     }
 
@@ -66,5 +66,5 @@
         throw new ArgumentException("Number of parents must be exactly two for symbolic expression tree crossover operators.");
 
-      SymbolicExpressionTree result = Cross(Random, Parents[0], Parents[1]);
+      ISymbolicExpressionTree result = Cross(Random, Parents[0], Parents[1]);
 
       Child = result;
@@ -72,6 +72,6 @@
     }
 
-    protected abstract SymbolicExpressionTree Cross(IRandom random,
-      SymbolicExpressionTree parent0, SymbolicExpressionTree parent1);
+    protected abstract ISymbolicExpressionTree Cross(IRandom random,
+      ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1);
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/DefaultSymbolicExpressionGrammar.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/DefaultSymbolicExpressionGrammar.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/DefaultSymbolicExpressionGrammar.cs	(revision 5510)
@@ -74,5 +74,5 @@
     }
     [Storable]
-    private IEnumerable<KeyValuePair<string, Symbol>> AllSymbols {
+    private IEnumerable<KeyValuePair<string, ISymbol>> AllSymbols {
       get { return allSymbols.AsEnumerable(); }
       set { allSymbols = value.ToDictionary(x => x.Key, x => x.Value); }
@@ -83,7 +83,7 @@
     private Dictionary<string, int> maxSubTreeCount;
     private Dictionary<string, List<List<string>>> allowedChildSymbols;
-    private Dictionary<string, Symbol> allSymbols;
-    [Storable]
-    private Symbol startSymbol;
+    private Dictionary<string, ISymbol> allSymbols;
+    [Storable]
+    private ISymbol startSymbol;
 
     [StorableConstructor]
@@ -103,9 +103,9 @@
       maxSubTreeCount = new Dictionary<string, int>(original.maxSubTreeCount);
 
-      allSymbols = new Dictionary<string, Symbol>();
-      foreach (Symbol symbol in original.allSymbols.Values.Select(s => cloner.Clone(s)))
+      allSymbols = new Dictionary<string, ISymbol>();
+      foreach (ISymbol symbol in original.allSymbols.Values.Select(s => cloner.Clone(s)))
         allSymbols.Add(symbol.Name, symbol);
 
-      startSymbol = cloner.Clone<Symbol>(original.startSymbol);
+      startSymbol = cloner.Clone<ISymbol>(original.startSymbol);
       allowedChildSymbols = new Dictionary<string, List<List<string>>>();
       foreach (var entry in original.allowedChildSymbols) {
@@ -121,5 +121,5 @@
       this.maxSubTreeCount = new Dictionary<string, int>();
       this.allowedChildSymbols = new Dictionary<string, List<List<string>>>();
-      this.allSymbols = new Dictionary<string, Symbol>();
+      this.allSymbols = new Dictionary<string, ISymbol>();
       this.cachedMinExpressionLength = new Dictionary<string, int>();
       this.cachedMaxExpressionLength = new Dictionary<string, int>();
@@ -142,10 +142,10 @@
       this.maxSubTreeCount = new Dictionary<string, int>();
       this.allowedChildSymbols = new Dictionary<string, List<List<string>>>();
-      this.allSymbols = new Dictionary<string, Symbol>();
-
-      this.StartSymbol = (Symbol)cloner.Clone(grammar.StartSymbol);
-
-      foreach (Symbol symbol in grammar.Symbols) {
-        Symbol clonedSymbol = (Symbol)cloner.Clone(symbol);
+      this.allSymbols = new Dictionary<string, ISymbol>();
+
+      this.StartSymbol = (ISymbol)cloner.Clone(grammar.StartSymbol);
+
+      foreach (ISymbol symbol in grammar.Symbols) {
+        ISymbol clonedSymbol = (ISymbol)cloner.Clone(symbol);
         this.AddSymbol(clonedSymbol);
         this.SetMinSubtreeCount(clonedSymbol, grammar.GetMinSubtreeCount(symbol));
@@ -153,9 +153,9 @@
       }
 
-      foreach (Symbol parent in grammar.Symbols) {
+      foreach (ISymbol parent in grammar.Symbols) {
         for (int i = 0; i < grammar.GetMaxSubtreeCount(parent); i++) {
-          foreach (Symbol child in grammar.Symbols) {
+          foreach (ISymbol child in grammar.Symbols) {
             if (grammar.IsAllowedChild(parent, child, i)) {
-              this.SetAllowedChild((Symbol)cloner.Clone(parent), (Symbol)cloner.Clone(child), i);
+              this.SetAllowedChild((ISymbol)cloner.Clone(parent), (ISymbol)cloner.Clone(child), i);
             }
           }
@@ -181,10 +181,10 @@
 
     #region ISymbolicExpressionGrammar Members
-    public Symbol StartSymbol {
+    public ISymbol StartSymbol {
       get { return startSymbol; }
       set { startSymbol = value; }
     }
 
-    public void AddSymbol(Symbol symbol) {
+    public void AddSymbol(ISymbol symbol) {
       if (ContainsSymbol(symbol)) throw new ArgumentException("Symbol " + symbol + " is already defined.");
       allSymbols.Add(symbol.Name, symbol);
@@ -193,5 +193,5 @@
     }
 
-    public void RemoveSymbol(Symbol symbol) {
+    public void RemoveSymbol(ISymbol symbol) {
       foreach (var parent in Symbols) {
         for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
@@ -206,13 +206,13 @@
     }
 
-    public IEnumerable<Symbol> Symbols {
+    public IEnumerable<ISymbol> Symbols {
       get { return allSymbols.Values.AsEnumerable(); }
     }
 
-    public bool ContainsSymbol(Symbol symbol) {
+    public bool ContainsSymbol(ISymbol symbol) {
       return allSymbols.ContainsKey(symbol.Name);
     }
 
-    public void SetAllowedChild(Symbol parent, Symbol child, int argumentIndex) {
+    public void SetAllowedChild(ISymbol parent, ISymbol child, int argumentIndex) {
       if (!ContainsSymbol(parent)) throw new ArgumentException("Unknown symbol: " + parent, "parent");
       if (!ContainsSymbol(child)) throw new ArgumentException("Unknown symbol: " + child, "child");
@@ -222,5 +222,5 @@
     }
 
-    public bool IsAllowedChild(Symbol parent, Symbol child, int argumentIndex) {
+    public bool IsAllowedChild(ISymbol parent, ISymbol child, int argumentIndex) {
       if (!ContainsSymbol(parent)) throw new ArgumentException("Unknown symbol: " + parent, "parent");
       if (!ContainsSymbol(child)) throw new ArgumentException("Unknown symbol: " + child, "child");
@@ -230,5 +230,5 @@
 
     private Dictionary<string, int> cachedMinExpressionLength;
-    public int GetMinExpressionLength(Symbol symbol) {
+    public int GetMinExpressionLength(ISymbol symbol) {
       if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
       if (!cachedMinExpressionLength.ContainsKey(symbol.Name)) {
@@ -246,5 +246,5 @@
 
     private Dictionary<string, int> cachedMaxExpressionLength;
-    public int GetMaxExpressionLength(Symbol symbol) {
+    public int GetMaxExpressionLength(ISymbol symbol) {
       if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
       if (!cachedMaxExpressionLength.ContainsKey(symbol.Name)) {
@@ -262,5 +262,5 @@
 
     private Dictionary<string, int> cachedMinExpressionDepth;
-    public int GetMinExpressionDepth(Symbol symbol) {
+    public int GetMinExpressionDepth(ISymbol symbol) {
       if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
       if (!cachedMinExpressionDepth.ContainsKey(symbol.Name)) {
@@ -275,5 +275,5 @@
     }
 
-    public void SetMaxSubtreeCount(Symbol symbol, int nSubTrees) {
+    public void SetMaxSubtreeCount(ISymbol symbol, int nSubTrees) {
       if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
       maxSubTreeCount[symbol.Name] = nSubTrees;
@@ -286,5 +286,5 @@
     }
 
-    public void SetMinSubtreeCount(Symbol symbol, int nSubTrees) {
+    public void SetMinSubtreeCount(ISymbol symbol, int nSubTrees) {
       if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
       minSubTreeCount[symbol.Name] = nSubTrees;
@@ -292,10 +292,10 @@
     }
 
-    public int GetMinSubtreeCount(Symbol symbol) {
+    public int GetMinSubtreeCount(ISymbol symbol) {
       if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
       return minSubTreeCount[symbol.Name];
     }
 
-    public int GetMaxSubtreeCount(Symbol symbol) {
+    public int GetMaxSubtreeCount(ISymbol symbol) {
       if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
       return maxSubTreeCount[symbol.Name];
@@ -313,5 +313,5 @@
       maxSubTreeCount = new Dictionary<string, int>(original.maxSubTreeCount);
 
-      allSymbols = new Dictionary<string, Symbol>(original.allSymbols);
+      allSymbols = new Dictionary<string, ISymbol>(original.allSymbols);
       startSymbol = original.startSymbol;
       allowedChildSymbols = new Dictionary<string, List<List<string>>>(original.allowedChildSymbols.Count);
@@ -323,5 +323,4 @@
       }
     }
-
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeStringFormatter.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeStringFormatter.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeStringFormatter.cs	(revision 5510)
@@ -46,5 +46,5 @@
     }
 
-    public string Format(SymbolicExpressionTree symbolicExpressionTree) {
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
       return FormatRecursively(symbolicExpressionTree.Root, 0);
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/GlobalSymbolicExpressionGrammar.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/GlobalSymbolicExpressionGrammar.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/GlobalSymbolicExpressionGrammar.cs	(revision 5510)
@@ -79,5 +79,5 @@
     }
 
-    public GlobalSymbolicExpressionGrammar(ISymbolicExpressionGrammar mainBranchGrammar)
+    public GlobalSymbolicExpressionGrammar(ISymbolicExpressionTreeGrammar mainBranchGrammar)
       : base(mainBranchGrammar) {
       maxFunctionArguments = 3;
@@ -121,5 +121,5 @@
 
     [Obsolete]
-    private void Initialize(ISymbolicExpressionGrammar mainBranchGrammar) {
+    private void Initialize(ISymbolicExpressionTreeGrammar mainBranchGrammar) {
       base.Clear();
 
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 5510)
@@ -109,7 +109,7 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs" />
     <Compile Include="Analyzers\SymbolicExpressionSymbolFrequencyAnalyzer.cs" />
-    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeSizeAnalyzer.cs" />
-    <Compile Include="Analyzers\SymbolicExpressionTreeSizeCalculator.cs" />
+    <Compile Include="Analyzers\SymbolicExpressionTreeLengthCalculator.cs" />
     <Compile Include="ArchitectureManipulators\ArgumentCreater.cs" />
     <Compile Include="ArchitectureManipulators\ArgumentDeleter.cs" />
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs	(revision 5510)
@@ -25,5 +25,5 @@
   public interface ISymbol : INamedItem {
     ISymbolicExpressionTreeNode CreateTreeNode();
-    double InitialFrequency;
+    double InitialFrequency { get; }
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTree.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTree.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTree.cs	(revision 5510)
@@ -25,5 +25,5 @@
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
   public interface ISymbolicExpressionTree : IItem {
-    ISymbolicExpressionTreeNode Root { get; }
+    ISymbolicExpressionTreeNode Root { get; set; }
     int Size { get; }
     int Height { get; }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 5510)
@@ -22,8 +22,9 @@
 using HeuristicLab.Core;
 using System;
+using HeuristicLab.Common;
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
-  public interface ISymbolicExpressionTreeNode : IItem {
+  public interface ISymbolicExpressionTreeNode : IDeepCloneable {
     ISymbolicExpressionTreeGrammar Grammar { get; }
-
+    ISymbolicExpressionTreeNode Parent { get; set; }
     ISymbol Symbol { get; }
     bool HasLocalParameters { get; }
@@ -37,6 +38,6 @@
     IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix();
     IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix();
-    void ForEachNodePostfix(Action<SymbolicExpressionTreeNode> a);
-    void ForEachNodePrefix(Action<SymbolicExpressionTreeNode> a);
+    void ForEachNodePostfix(Action<ISymbolicExpressionTreeNode> a);
+    void ForEachNodePrefix(Action<ISymbolicExpressionTreeNode> a);
 
     IEnumerable<ISymbolicExpressionTreeNode> SubTrees { get; }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeManipulator.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeManipulator.cs	(revision 5510)
@@ -28,5 +28,5 @@
   /// </summary>
   public interface ISymbolicExpressionTreeManipulator : ISymbolicExpressionTreeOperator, IManipulator {
-    ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+    ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs	(revision 5510)
@@ -41,9 +41,9 @@
     }
 
-    protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree) {
+    protected override void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
       ChangeNodeType(random, symbolicExpressionTree);
     }
 
-    public static void ChangeNodeType(IRandom random, SymbolicExpressionTree symbolicExpressionTree) {
+    public static void ChangeNodeType(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
 
       // select any node as parent (except the root node)
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs	(revision 5510)
@@ -54,5 +54,5 @@
     }
 
-    protected override void Manipulate(IRandom random, SymbolicExpressionTree tree) {
+    protected override void Manipulate(IRandom random, ISymbolicExpressionTree tree) {
       tree.Root.ForEachNodePostfix(node => {
         if (node.HasLocalParameters) {
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs	(revision 5510)
@@ -26,4 +26,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Parameters;
+using System.Collections.Generic;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
@@ -54,11 +55,11 @@
     }
 
-    protected override void Manipulate(IRandom random, SymbolicExpressionTree tree) {
-      var parametricNodes = from node in tree.IterateNodesPrefix()
-                            where node.HasLocalParameters
-                            select node;
-      if (parametricNodes.Count() > 0) {
+    protected override void Manipulate(IRandom random, ISymbolicExpressionTree tree) {
+      List<ISymbolicExpressionTreeNode> parametricNodes = new List<ISymbolicExpressionTreeNode>();
+      tree.Root.ForEachNodePostfix(n => {
+        if (n.HasLocalParameters) parametricNodes.Add(n);
+      });
+      if (parametricNodes.Count > 0) {
         var selectedPoint = parametricNodes.SelectRandom(random);
-
         selectedPoint.ShakeLocalParameters(random, ShakingFactor.Value);
       }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs	(revision 5510)
@@ -36,11 +36,11 @@
 
     #region Parameter Properties
-    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
-      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     }
     #endregion
 
     #region Properties
-    public SymbolicExpressionTree SymbolicExpressionTree {
+    public ISymbolicExpressionTree SymbolicExpressionTree {
       get { return SymbolicExpressionTreeParameter.ActualValue; }
     }
@@ -52,9 +52,9 @@
     public SymbolicExpressionTreeManipulator()
       : base() {
-      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
     }
 
     public sealed override IOperation Apply() {
-      SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
+      ISymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
       Manipulate(RandomParameter.ActualValue, tree);
 
@@ -62,5 +62,5 @@
     }
 
-    protected abstract void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree);
+    protected abstract void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree);
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 5510)
@@ -31,7 +31,7 @@
   public class SymbolicExpressionTreeNode : DeepCloneable, ISymbolicExpressionTreeNode {
     [Storable]
-    private IList<SymbolicExpressionTreeNode> subTrees;
+    private IList<ISymbolicExpressionTreeNode> subTrees;
     [Storable]
-    private Symbol symbol;
+    private ISymbol symbol;
 
     // cached values to prevent unnecessary tree iterations
@@ -39,5 +39,5 @@
     private ushort height;
 
-    public Symbol Symbol {
+    public ISymbol Symbol {
       get { return symbol; }
       protected set { symbol = value; }
@@ -45,6 +45,6 @@
 
     // parent relation is not persisted or cloned (will be set on AddSubtree or RemoveSubtree)
-    private SymbolicExpressionTreeNode parent;
-    internal SymbolicExpressionTreeNode Parent {
+    private ISymbolicExpressionTreeNode parent;
+    public ISymbolicExpressionTreeNode Parent {
       get { return parent; }
       set { parent = value; }
@@ -56,6 +56,6 @@
       : base() {
       symbol = original.symbol; // symbols are reused
-      subTrees = new List<SymbolicExpressionTreeNode>(original.SubTrees.Count);
-      foreach (var subtree in original.SubTrees) {
+      subTrees = new List<ISymbolicExpressionTreeNode>(original.subTrees.Count);
+      foreach (var subtree in original.subTrees) {
         var clonedSubTree = cloner.Clone(subtree);
         subTrees.Add(clonedSubTree);
@@ -73,7 +73,7 @@
     }
 
-    public SymbolicExpressionTreeNode(Symbol symbol)
+    public SymbolicExpressionTreeNode(ISymbol symbol)
       : base() {
-      subTrees = new List<SymbolicExpressionTreeNode>(3);
+      subTrees = new List<ISymbolicExpressionTreeNode>(3);
       this.symbol = symbol;
     }
@@ -82,5 +82,5 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      foreach (var subtree in SubTrees) {
+      foreach (var subtree in subTrees) {
         subtree.Parent = this;
       }
@@ -91,5 +91,5 @@
     }
 
-    public virtual IList<SymbolicExpressionTreeNode> SubTrees {
+    public virtual IEnumerable<ISymbolicExpressionTreeNode> SubTrees {
       get { return subTrees; }
     }
@@ -103,7 +103,7 @@
       else {
         size = 1;
-        if (SubTrees != null) {
-          for (int i = 0; i < SubTrees.Count; i++) {
-            checked { size += (ushort)SubTrees[i].GetSize(); }
+        if (subTrees != null) {
+          for (int i = 0; i < subTrees.Count; i++) {
+            checked { size += (ushort)subTrees[i].GetSize(); }
           }
         }
@@ -115,6 +115,6 @@
       if (height > 0) return height;
       else {
-        if (SubTrees != null) {
-          for (int i = 0; i < SubTrees.Count; i++) height = Math.Max(height, (ushort)SubTrees[i].GetHeight());
+        if (subTrees != null) {
+          for (int i = 0; i < subTrees.Count; i++) height = Math.Max(height, (ushort)subTrees[i].GetHeight());
         }
         height++;
@@ -126,47 +126,51 @@
     public virtual void ShakeLocalParameters(IRandom random, double shakingFactor) { }
 
-    public virtual void AddSubTree(SymbolicExpressionTreeNode tree) {
-      SubTrees.Add(tree);
+    public virtual ISymbolicExpressionTreeNode GetSubTree(int index) {
+      return subTrees[index];
+    }
+    public virtual int IndexOfSubTree(ISymbolicExpressionTreeNode tree) {
+      return subTrees.IndexOf(tree);
+    }
+    public virtual void AddSubTree(ISymbolicExpressionTreeNode tree) {
+      subTrees.Add(tree);
       tree.Parent = this;
       ResetCachedValues();
     }
-
-    public virtual void InsertSubTree(int index, SymbolicExpressionTreeNode tree) {
-      SubTrees.Insert(index, tree);
+    public virtual void InsertSubTree(int index, ISymbolicExpressionTreeNode tree) {
+      subTrees.Insert(index, tree);
       tree.Parent = this;
       ResetCachedValues();
     }
-
     public virtual void RemoveSubTree(int index) {
-      SubTrees[index].Parent = null;
-      SubTrees.RemoveAt(index);
+      subTrees[index].Parent = null;
+      subTrees.RemoveAt(index);
       ResetCachedValues();
     }
 
-    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix() {
-      List<SymbolicExpressionTreeNode> list = new List<SymbolicExpressionTreeNode>();
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix() {
+      List<ISymbolicExpressionTreeNode> list = new List<ISymbolicExpressionTreeNode>();
       ForEachNodePrefix((n) => list.Add(n));
       return list;
     }
 
-    public void ForEachNodePrefix(Action<SymbolicExpressionTreeNode> a) {
+    public void ForEachNodePrefix(Action<ISymbolicExpressionTreeNode> a) {
       a(this);
       if (SubTrees != null) {
-        for (int i = 0; i < SubTrees.Count; i++) {
-          SubTrees[i].ForEachNodePrefix(a);
-        }
-      }
-    }
-
-    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix() {
-      List<SymbolicExpressionTreeNode> list = new List<SymbolicExpressionTreeNode>();
+        foreach (var subtree in SubTrees) {
+          subtree.ForEachNodePrefix(a);
+        }
+      }
+    }
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix() {
+      List<ISymbolicExpressionTreeNode> list = new List<ISymbolicExpressionTreeNode>();
       ForEachNodePostfix((n) => list.Add(n));
       return list;
     }
 
-    public void ForEachNodePostfix(Action<SymbolicExpressionTreeNode> a) {
+    public void ForEachNodePostfix(Action<ISymbolicExpressionTreeNode> a) {
       if (SubTrees != null) {
-        for (int i = 0; i < SubTrees.Count; i++) {
-          SubTrees[i].ForEachNodePostfix(a);
+        foreach (var subtree in SubTrees) {
+          subtree.ForEachNodePostfix(a);
         }
       }
@@ -190,5 +194,6 @@
     private void ResetCachedValues() {
       size = 0; height = 0;
-      if (parent != null) parent.ResetCachedValues();
+      SymbolicExpressionTreeNode parentNode = parent as SymbolicExpressionTreeNode;
+      if (parentNode != null) parentNode.ResetCachedValues();
     }
   }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeSizeConstraintOperator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeSizeConstraintOperator.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeSizeConstraintOperator.cs	(revision 5510)
@@ -52,7 +52,4 @@
 
     #region Properties
-    public IRandom Random {
-      get { return RandomParameter.ActualValue; }
-    }
     public IntValue MaximumSymbolicExpressionTreeLength {
       get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs	(revision 5510)
@@ -24,12 +24,12 @@
 using HeuristicLab.Common;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System.Linq;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
   [StorableClass]
   public abstract class SymbolicExpressionTreeTerminalNode : SymbolicExpressionTreeNode {
-    private static List<SymbolicExpressionTreeNode> emptyList = new List<SymbolicExpressionTreeNode>();
-    public override IList<SymbolicExpressionTreeNode> SubTrees {
+    public override IEnumerable<ISymbolicExpressionTreeNode> SubTrees {
       get {
-        return SymbolicExpressionTreeTerminalNode.emptyList;
+        return Enumerable.Empty<ISymbolicExpressionTreeNode>();
       }
     }
@@ -37,5 +37,5 @@
     [StorableConstructor]
     protected SymbolicExpressionTreeTerminalNode(bool deserializing) : base(deserializing) { }
-    // don't call storable constructor of base to prevent allocation of sub-trees list in base!
+    // don't call cloning constructor of base to prevent allocation of sub-trees list in base!
     protected SymbolicExpressionTreeTerminalNode(SymbolicExpressionTreeTerminalNode original, Cloner cloner)
       : base() {
@@ -51,8 +51,14 @@
     }
 
-    public override void AddSubTree(SymbolicExpressionTreeNode tree) {
+    public override int IndexOfSubTree(ISymbolicExpressionTreeNode tree) {
+      return -1;
+    }
+    public override ISymbolicExpressionTreeNode GetSubTree(int index) {
       throw new NotSupportedException();
     }
-    public override void InsertSubTree(int index, SymbolicExpressionTreeNode tree) {
+    public override void AddSubTree(ISymbolicExpressionTreeNode tree) {
+      throw new NotSupportedException();
+    }
+    public override void InsertSubTree(int index, ISymbolicExpressionTreeNode tree) {
       throw new NotSupportedException();
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 5510)
@@ -55,5 +55,5 @@
     }
 
-    public override SymbolicExpressionTreeNode CreateTreeNode() {
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
       return new ArgumentTreeNode(this);
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs	(revision 5510)
@@ -42,5 +42,5 @@
     }
 
-    public override SymbolicExpressionTreeNode CreateTreeNode() {
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
       return new DefunTreeNode(this);
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 5510)
@@ -60,5 +60,5 @@
     }
 
-    public override SymbolicExpressionTreeNode CreateTreeNode() {
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
       return new InvokeFunctionTreeNode(this);
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs	(revision 5510)
@@ -38,5 +38,5 @@
       return new ProgramRootSymbol(this, cloner);
     }
-    public override SymbolicExpressionTreeNode CreateTreeNode() {
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
       return new SymbolicExpressionTreeTopLevelNode(this);
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs	(revision 5510)
@@ -39,5 +39,5 @@
     }
 
-    public override SymbolicExpressionTreeNode CreateTreeNode() {
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
       return new SymbolicExpressionTreeTopLevelNode(this);
     }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 5509)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 5510)
@@ -64,5 +64,5 @@
 
 
-    public virtual SymbolicExpressionTreeNode CreateTreeNode() {
+    public virtual ISymbolicExpressionTreeNode CreateTreeNode() {
       return new SymbolicExpressionTreeNode(this);
     }
