Moved to new doc exporting function