Template restructuring