Reordering the structure

more compatible with different decoders now