Refactor addTodoItem method