Code refactoring and cleanup in gossip service to support online and status messages.