Modified AsyncTasks and cleaned up some code