lint: reduce scope

Fix some lint warnings of kind
```
style (variableScope): The scope of the variable '…' can be reduced
```
Same as above: I think it's more consistent either to leave out all appearances of "`else`" (if the `if` branch returns anyways) or to let them remain. May just be personal preference, though.