ruby csv refactor