Add support for templates