refactoring tree file