Refactored tree view