test_serializer code cleans up