minor: use `foreach` instead of `map`