Moving to a class for easier unit testing
Adding keep alive message