refactoring of export to csv module, and one possible bugfix