This is a simple refactoring, extracting common ancestor negotiation logic to named function
Attach a file by drag & drop or click to upload