more work on clean tasks
avoid list confusion in rewrite tasks
improve readability
introduced index task, which is handy for forall tasks
layout