refactor parse-response.js