Simplify waiting functions a bit