some code tweaks