created a serialization helper.