rearrange class structure