Refactor type_integration