core: consolidate logic so that queue process only requires a single callback from _processFile.