java 8 refactorings - use forEach instead of simple for loops