Maybe use temporary variables here so you don't have this awkward looking conditional?