restructure tree controller