[INTERNAL] further cleanup and speed-improvements of EmpiricalFormula