Refactoring on TasksActivity class.