Refactor `navigator.js`