Revert "Add wait function"

This reverts commit e1ebbc37407e37845cc23b2c28ba6689f552ba94.