tree usage refactoring ftw