splitting out parsing JS into tmp file + cleanup