If the only issue is `public`s you can throw in a simple script that runs over the generated code and removes them. Semantically that would be similar to a code optimizer running over Java bytecode. KotlinPoet prioritizes correctness and explicitness over readability, it’s not a tool you want to use if your goal is to generate human-readable and editable code.