How about inline `is_same_cmty` and convert `map()`/`filter()` into a generator expression?