Cleaning up usb code implementing helper methods for converting data to a byte stream