Allow injecting custom serializer