functional templating system