refact message output