Refactor to eventually do receive as well as transmit