Improve unset logic