Refactor tree structure again.