Improve foreach.