refactor state serializers