recursive templater