Refactor menu.js