js: 'some' refactoring