refactor type