csv parser refactered