Add support for dynamic templates