refactor type map