Working with nested templates