Refactoring. Changed methods for evaluating a formula.