Reorganize communications code.