Refactoring for interrupts.