Rearrange for better cache