Small code refactoring in todo-list example