See my other comment about the AllocationCommand factories.

I could store the factory only once by making it part of the class, if that is desired, instead of looking it up every time.