Adjustments on CSV generation and cleanup

and here