Improves style, not using var in if, and reduces indendation.