Refactored Calculator