`ThreadUI.createEditableRecipient(e.target.dataset)` and you can remove the 6 first lines.

Of course you need to modify `createEditableRecipient` to use `phoneNumber` instead of `number`.