a few more tweaks and cleanup