Factored out duplicate code when loading external stylesheets.