Refactor, add missing interrupt subroutine