async refactoring