Convert simple for each loops into lambas