refctor url match algrothim

refctor url match algrothim