CDN module big refractor and some little changes