Refine phase generation, rename stuff.