Improve logic for when we need to process/can skip a file.