Refactored serial port to be have only serial port level functionality.