One of my favourite tricks to keep down indentation levels like three nested if:s, is to plain exit a function as soon as we know it won’t do anything. (Yes; I admit I’m mostly testing github features here. ;-)