Cleanup of code and generated code