Rearrange class structure