Revert "edit js to avoid repeating"

This reverts commit 88c81148d598ffb3c1ff3afed1759fdc13368fda.