Homepage JS optimization