finished template restructuring