template restructure