refactor to async