Improve methods to close the communication.