make template generic