For this kind of cases: I recommend to get rid of 1 level of nesting. I.e. if ... => return. Flatter hierarchies are more readable.