Moved getFactors to CommonFunctions