Use io.Copy when writing templates