change code style
flatten todo data structure