Re-structured to separate serial i/o from interrupt.