Modular thinking: one responsibility per file
A module is not only a file. It is also a clear contract with the rest of the system.
Think of each module as a box with a public API. What you export is what other parts of the app are allowed to know about.
When you split code by domain such as formatting, validation, API or UI, maintenance depends less on personal memory.