inlining url cleaning in head for faster url cleaning