calculatormodel refactoring