Refactoring rover.js and replace advance