replaced global template lookup object with per-root node class object