Refactor async.js