TestSerialization refactoring