css: improve building and applying