refactor addTodo