I noticed some opportunity to collapse some of the logic, in case you are interested.
Attach a file by drag & drop or click to upload