Better generics to get rid of warnings.