Refactoring of the async implementation