You can ask the llm to write code the way you think about it. I usually write a little spec document as my first prompt, and in there i'll add some rules on how I want code structured, seperated etc.
If you use cursor, cursorrules can be a good way of doing this.