optimize order of styles and scripts