Cleanup:Use get_type()instead of get_header().type

Cleanup the code ,use get_type() instead of get_header().type
for messages.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>