Refactored all Activities to handle tasks in the background