Abstracting the async loop by removing inner loop object