refactor as for-loop

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