[js] eng + refactoring