Restructures the encoder block