write templates