Add the generation key system.
Refactoring