Refactor package structure of core.message.
Remove unnecessary classes for keepalive logic.