Cleaned up type introspection code again