little restructuring for viewing/exporting data