restructured js and html files