It would probably make sense to move this if-block before the for loop ?