major changes to js optimization