Updated the template service to load nested templates