Refactored TreeEditor