interrupt handler code reorg