Refactoring : extracted similar code to FormulaItem