Moved around write to csv generation sources