Replace loops by streams & lambdas