Refactor sync_trigger