Make keepalive a class