further tweaks and cleanups