Custom serialization. Base form.