Refactor async process handling