memory usage optimization (add __slots__ to facts)