More JS Refactoring.