Reworked to use scala reflection so I can see parameterized types. Needs work in tests