public void ReduceTree(NodeGrouper nodeGrouper) { var templateMatcher = new TemplateMatcher(nodeGrouper); Roots = Roots.ToDictionary(r => r.Key, r => templateMatcher.Reduce(r.Value)); NoOutputInstructions = NoOutputInstructions.ToDictionary(r => r.Key, r => templateMatcher.Reduce(r.Value)); }