refactor decision tree