updated to use virtual serialize() and deserialize() methods