added dependency injection for mocking rpc client