refactor
update the todo logic