- use C++11 foreach
- shorter code