refactored calculator package