made template generic