So we can extend it with additional utility functions without making it confusing. No functional change.
In a few cases, also avoid a sleep in the last (failed) iteration of the loop. It doesn't matter too much, but it's still ugly.