first iteration of deduplication state machine implementation