Reworked the logic of reading RDATA