move exporting code to separate class