Communication code cleaned up and improved.