Replace blocking function calls with awaits.