Update local state to use map instead of each.