enhanced var handling