minor refactoring on async callbacks