refactory interrupts.c