Remove unneeded extra level of if