some cleanups and tweaks