code cleanup in gossip system