refactor type def