Use Begin/End pattern to not break .Net 4 compatibility.

`if` blocks need to have braces, keeps the style consistent.