refactor adapter_to_name()