moved export functionality out of char