Some functionalities for serial_util, but in a bad framework.