add until function for generating template variables