refactor to allow mocking of non-ingester env