Change the code style and add totalProcessedRecords