cleaned up the file processing