Use shortcut way to create scoped_ptr.
No need for custom dealloc.
Separate the message parsing into a new function.