JS refactorings.