You have hard coded the implementation types. Code to the interfaces of those types and you can then pass in any concrete type that implements the interface. If that doesn't make sense, I will try to clarify. Good luck!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.