dependency inversion principle refactor