template more cleanup, category tree rendering