refactored task with factory, changed how completed tasks are handled