Clean up export logic a bit