Refactoring playergossip code