extracted common messaging code to 'common' module