custom csv export functionality update. some cleanup