small refactor for prepare_send_data in utils