cleanup, fixes and tweaks