Refactor to use mocked web client in test