Avoid use of `var`. Add braces on if statement