some UART lib optimizations