Refactoring pattern & wait check