first pass at adding templating support