some tweaks on scoping vars