Updated todo-list example: Small code refactor