Little optimization

The master version don't need the foeach at all.