refactored, type map and trait map are two different objects