messages helper rewrited