minor code tweaks
more minor code tweaks