template restructuring