Update templates to use specialize()