refining JS