Yet another rewrite