Nested templates

Allow for nested templates