Refactoring calculator event