Rewrite some stuff