proper implementation of Rewrite tasks