refac: readability/consistency

- replace while(1) with while(true)
move logic into method OverlayClient::readyReadMsgInit; add curly braces