major set of optimizations for the template engine visitor resolution process