Calculator - refactor