Refactor calculator event