Refactor the js files.