optimizing message exchange