made rtr.handleSoc easier to read