better way to handle optional boolean field