refactored code so that query is a generic async.parallel function so that it can be reused.