Switched to AsyncTasks, plus refactoring.