Yeah this is the "D"[1] is SOLID [2]. Robert "Uncle Bob" Martin talks about this in his books Clean Code and Clean Architecture. I'd recommend them. Clean Architecture is really good as an audio book.
[1] https://en.wikipedia.org/wiki/Dependency_inversion_principle