Much refactoring of layouts and stylesheets