Refactor the decision tree.