cleanup and a few tweaks