[JS] Continue refactoring work