Refactor todo-list directive