rearrange to fix build issues