Refactor stylesheets generation