updated doc
code refactoring, merged irqhandler functions together