Cleaning up headers and generics.

- Removing unused imports.
- Minor tweaks to use of generics.