nit: it seems like the calls to `getFileInfoList` should be consolidated into one, especially given that the results are being saved by this one.