unify handle_keep_alive_command