Refinements to generics code