Refactoring generator code, fix assets generator