Mmmm... I can see what you're trying to do here, but it might help readability if you can split this embedded 'if' out? Same comment below, too.