extract code to req_util.js