some optimization & fix on csvreader