Convert to template