Improve history.js and app.js for upcoming shift