refactor how csv exports work.