Refactor asynclib.