extract mapTodos, filterTodos to clean up the mess in the model