refactoring wait methods