Added support for embedded templates