refactoring js files.