serialize template data