lint: reduce scope

Fix some lint warnings of kind
```
style (variableScope): The scope of the variable '…' can be reduced
```
+1.

Reasoning: There have been multiple declarations of 'data' before, hence the additional brackets.