refactor top-bar Jquery code to be in app.js