[new] Complete rewrite