formatting js + removing un-used ids in html