refactor display_export.lib.php