reconstruct template