of course , i mused , the old fox , lord lovat , had managed to play off both sides of the jacobite rising last time , simultaneously ingratiating himself with the hanovers and retaining the favor of the stuarts .