Externalized serializing/deserializing code to another class