the code that generates the CSV report has been refactored