Slightly cleaned up communication routines.