refactoring for a asynchronous tests