Improve communications code