Refine UART driver