allow configuration of serialization behavior, closes #1210