very minor merge of two separate if statements