Abstract sync/async functions in a helper method
Add unit test for runAsync