removing junk js and collapsing into 1