Improved mapping of types to modules