Added generics.
Clean up.