reorganize tree controller