Cleaned up interrupt code