move lookup and initialization of service object in to a separate class

I think this improves the readability of the code and makes it easier to reason about what's happening. The behaviour should be near identical, I've simply restructured the code (to assist with some troubleshooting I've been doing).