small logic tweaks