Made serializer format configurable.