refactoring change for the javascript file