restructure Template/View system