Csv refactor