Registry and Generator split. Refactored the code