refactored ingester out of main class