There is no good way I know of refactoring selector-driven stylesheets. Procedural styling, such as that used by smarty or even vanilla PHP, is easy. Styling starts in one place and flows in a controlled way through to the end. Selectors make life difficult because you don't know what is going to match where or what is overridden by a different selector elsewhere. It's very difficult to work out how it works, even with comments, because you don't know which comments are immediately relevant and besides, they refer to a document structure which is dynamically generated.