Refactor mt_tree