make checkbox change logic more succinct and less brittle