extract method 
```scala
private def isLocal(flags: Map[String, Any]): Boolean = ...
```

Could even be a Protocol protected method so child classes do not need to know about the key.