docs: private boolean processRuleset(final Branch parent_branch, int depth) {
  
      // when we've passed the final rule, just return to stop the recursion
      if (rule_idx > max_rule_level) {
        return true;
      }
      
      // setup the branch for this iteration and set the "current_branch" 
      // reference. It's not final as we'll be copying references back and forth
      final Branch previous_branch = current_branch;
      current_branch = new Branch(tree.getTreeId());
      
      // fetch the current rule level or try to find the next one
      TreeMap<Integer, TreeRule> rule_level = fetchRuleLevel();
      if (rule_level == null) {
        return true;
      }
      
      // loop through each rule in the level, processing as we go
      for (Map.Entry<Integer, TreeRule> entry : rule_level.entrySet()) {
        // set the local rule
        rule = entry.getValue();
        testMessage("Processing rule: " + rule);
        
        // route to the proper handler based on the rule type
        if (rule.getType() == TreeRuleType.METRIC) {
          parseMetricRule();
          // local_branch = current_branch; //do we need this???
        } else if (rule.getType() == TreeRuleType.TAGK) {
          parseTagkRule();
        } else if (rule.getType() == TreeRuleType.METRIC_CUSTOM) {
          parseMetricCustomRule();
        } else if (rule.getType() == TreeRuleType.TAGK_CUSTOM) {
          parseTagkCustomRule();
        } else if (rule.getType() == TreeRuleType.TAGV_CUSTOM) {
          parseTagvRule();
        } else {
          throw new IllegalArgumentException("Unkown rule type: " + 
              rule.getType());
        }
        
        // rules on a given level are ORd so the first one that matches, we bail
        if (current_branch.getDisplayName() != null && 
            !current_branch.getDisplayName().isEmpty()) {
          break;
        }
      }
      
      // if no match was found on the level, then we need to set no match
      if (current_branch.getDisplayName() == null || 
          current_branch.getDisplayName().isEmpty()) {
        if (not_matched == null) {
          not_matched = new String(rule.toString());
        } else {
          not_matched += " " + rule;
        }
      }
      
      // determine if we need to continue processing splits, are done with splits
      // or need to increment to the next rule level
      if (splits != null && split_idx >= splits.length) {
        // finished split processing
        splits = null;
        split_idx = 0;
        rule_idx++;
      } else if (splits != null) {
        // we're still processing splits, so continue
      } else {
        // didn't have any splits so continue on to the next level
        rule_idx++;
      }
      
      // call ourselves recursively until we hit a leaf or run out of rules
      final boolean complete = processRuleset(current_branch, ++depth);
      
      // if the recursion loop is complete, we either have a leaf or need to roll
      // back
      if (complete) {
        // if the current branch is null or empty, we didn't match, so roll back
        // to the previous branch and tell it to be the leaf
        if (current_branch == null || current_branch.getDisplayName() == null || 
            current_branch.getDisplayName().isEmpty()) {
          LOG.trace("Got to a null branch");
          current_branch = previous_branch;
          return true;
        }
        
        // if the parent has an empty ID, we need to roll back till we find one
        if (parent_branch.getDisplayName() == null || 
            parent_branch.getDisplayName().isEmpty()) {
          testMessage("Depth [" + depth + 
              "] Parent branch was empty, rolling back");
          return true;
        }
        
        // add the leaf to the parent and roll back
        final Leaf leaf = new Leaf(current_branch.getDisplayName(), 
            meta.getTSUID());
        parent_branch.addLeaf(leaf, tree);
        testMessage("Depth [" + depth + "] Adding leaf [" + leaf + 
            "] to parent branch [" + parent_branch + "]");
        current_branch = previous_branch;
        return false;
      }
      
      // if a rule level failed to match, we just skip the result swap
      if ((previous_branch == null || previous_branch.getDisplayName().isEmpty()) 
          && !current_branch.getDisplayName().isEmpty()) {
        if (depth > 2) {
          testMessage("Depth [" + depth + 
              "] Skipping a non-matched branch, returning: " + current_branch);
        }
        return false;
      }
  
      // if the current branch is empty, skip it
      if (current_branch.getDisplayName() == null || 
          current_branch.getDisplayName().isEmpty()) {
        testMessage("Depth [" + depth + "] Branch was empty");
        current_branch = previous_branch;
        return false;
      }
      
      // if the previous and current branch are the same, we just discard the 
      // previous, since the current may have a leaf
      if (current_branch.getDisplayName().equals(previous_branch.getDisplayName())){
        testMessage("Depth [" + depth + "] Current was the same as previous");
        return false;
      }
      
      // we've found a new branch, so add it
      parent_branch.addChild(current_branch);
      testMessage("Depth [" + depth + "] Adding branch: " + current_branch + 
          " to parent: " + parent_branch);
      current_branch = previous_branch;
      return false;
    }