moved ingester into a class so it can be reused