Refactor waiting functions in negotiator