Waiting utils rewritten