Refactoring the CSV export service