Use hasValue instead of explicit nil checks.