Here is my poor attempt at maintaining backwards compatibility.