restructured to full use of message objects