Moved some common things for the uarts to a new file