initial refactoring of audittrailservice ingest code