refactoring appTree