Isolated the file processing in preparation for batch mode