Properly fix another warning.

Using generics.
Remove unused code.
Remove more unused code.