Data serialization refactord