refactoring js
js refactoring completed