Variables of looping tags should be created only in local scope
Reformat code