Wrote template code