Minor, but I'd be inclined to move this up as an `elsif` instead of nesting the if below.