refactored next async logic