Reworking receiving code