Serialize data when built