delete unused code and clean up TypeMap
remove unused code