major rearrangement to use IntentService.