Refactor get_token_type

add get_token_type