#20 better handling of template class (and fallback to underscore)