Updating JS to new format