refactor type check