Rearrangement of classes