refactored formulas