I think it's pretty well to you that's you discover your code must be better. when developers face this, there are ready to know more about architecture and writing better code and structure.
I think its not about just a specific design pattern. It's about Architecture and the project structure.
Beforehand, Developers used three separate layers in the project to separate presentation, logic(BLL), and database(DLL) from each other for a more well-organized structure. It just helps us to make everything around the database, But nowadays, developers have been encouraging to put everything around the domain(CORE). The domain is your business elements and everything around your business is details such as third-party services, database, and so on.
There are some specific names for this architecture such as onion, Port-adapters, Hexagonal and etc. All of this structure recommends us to put all of your domain things like Domain objects and others in the center of the project and anything else is around there.
I prefer to follow Uncle Bob naming which is "Clean architecture" that he describes it in his book "Clean Code: A Handbook of Agile Software Craftsmanship".
according to "Robert C.Martin" (Uncle Bob) descriptions, your architecture must be and screaming architecture It means everything in your architecture must be screamed when you see your architecture and anything must be clear. I highly recommend reading more about "Clean Architecture" Book. There is also many samples project on Github that implement the clean architecture.
on the other hand, all of your dependency must be injected to your layers but following this rule, Help you to use tests! the test and TDD pattern is very important two to develop and mitigate project bugs.
moreover, To increase your code readability and keep it clean it's very important to write "Clean Code" and also it needs to obey S.O.L.I.D principle rules. to achieve this goal I highly recommended reading "Clean Code" by Uncle Bob. there is a good brief of clean code rules in Java.
For the last word, I'd like to say it's very important to know more about gang of four design patterns. it helps us to solve common problems in code with beautiful well-known solutions. For more information, you can see here.
you can search more and find better things. Be success with your new code style ;)