Code cleaning and HELLO_RES_ACK coding