Js refactoring.