Refactored so it's easy to make new async tests.