Refactor coroutine agent searching process