Refactored the code so you can pass in an interface to service requests