Clean up uart code