use async, map, reduce instead of custom for loops