improve message functions