Code and generated code cleanup