refactoring tree.view