refactored excel export and results_as_table