Continue JS refactor