Refactored StringCalculator.py