added rewriteSource method
...