Calculator refactored.