Serialization helper refactor.