refactoring keep alive message