Custom serialization implemented.