refactor CSVReader/Writer