added support for inserting and injecting templates into other templates