Refactor prepare_results_for_Udi