Implementation of some util for handling messages