improved handling of template symbols