Refactor solution for 02_calculator