Remove unused imports.
Rework the code generator.