some fixes, some cleaning, and some rudimentary support for styles