Refactored into two modules: calculator and main.