Remove unnecessary generics; put all generics in a separate file.