minor reorganization
allow exporting to CSV via web