use local class for attaches dictionary
remove destroy_ closure from tmpl, pass instance as context to resolve value function