refactor csv parser
simplify loop