Refactor nav.js

Remove unused code