factor out the message bar functions.