extract out deleteTodo to factory