Use player ref to store and restore state

This a lot faster