Refactored createCb in asyncdispatch.