cleaning up
big refactoring of generic type classes.

not quite working..