Refactor layouts and stylesheets