Doing a bit of a rewrite