Improve url normalization func