jscript refactoring
refactoring