compile templates on the fly