slight reorg of procMessage function