refactor production code calculator class