Simplify TemplateGenerator method _walk