BTW can't we have a dataset instead of doing all this stuff with IDs ?

Maybe this does not belong to this bug but this should be taken care of in your "optimization" bug.