Can't use `Map.Entry` or similar here?