Refactored code to add a Communications layer.