converted to use new templates class