Add messages and make the encoding process much faster.