The `processMap()` function is only used inside the `getDirNamesForDuplicateFiles()` function, so logically it belongs here. It would have to be refactored a bit to make `filePaths` and `displayPaths` closure vars to be parameters, so I just kept it like it is.

I agree that nested functions can make functions harder to read. I could move it to the top of the function if you think that would help.