Set the correct factory in the container.