replace stream with iterator

Signed-off-by: Sebastian Schüpbach <sebastian.schuepbach@unibas.ch>
3 jobs for master in 5 minutes and 22 seconds (queued for 1 second)