`type` function was refactored