refactoring: moving type-check `check` into `get_type`