Refactor CSV