First attempt at state serialization