Some refactoring of the JS at the bottom of every page.