Refine logic of 99.js.