Schema refactoring

Generators and schema refactoring