abstracted out common exporter-related code