Refactored tasks into a service: tasksService