Rearrange ifdef's to make easier to read