Refactored FactGenerator to return MathFact object