add handlerwarp
modify msg factory
refactor code