Refactor - $modx->rewriteUrls()