Refactored generation, basically done.