more refactoring for calculation class