Refactor to make mocking nrepl client easier