minor code and formatting tweaks and cleanups.