JS Refactor.