Cleaned up uart code