various code tweaks
code tweaks