Understanding the template execution hierarchy