Why it is required to move this out of the loop?