refactored the solution

Placed the calculator in its own class and namespace