Moved export handling to util module.