Refactored wait blocks infrastructure