Improve url rewriting process