Rewrite to play more nicely with canonical library