small refactoring - moved waiting to the do expression